xaml

WPF window with custom chrome has unwanted outline on right and bottom

时光怂恿深爱的人放手 提交于 2020-12-29 05:46:48
问题 I have created a WPF window with custom chrome using the Microsoft.Windows.Shell dll. Here is the code for that: <Style TargetType="Window" x:Key="ChromeLessWindowStyle"> <Setter Property="shell:WindowChrome.WindowChrome"> <Setter.Value> <shell:WindowChrome GlassFrameThickness="0" ResizeBorderThickness="5" CornerRadius="5" CaptionHeight="30"> </shell:WindowChrome> </Setter.Value> </Setter> <Setter Property="WindowStyle" Value="None"/> <Setter Property="Template"> <Setter.Value>

How to make a squared image to a round image on Windows Phone

徘徊边缘 提交于 2020-12-29 03:25:04
问题 how is it possible to make a round image on Windows Phone of a squared image. I have a lot of images which should be displayed as a circle. But how can I do this? Thank. 回答1: In XAML you want to make the circle using an Ellipse control. Then give it an ImageBrush fill. <Ellipse Height="100" Width="100"> <Ellipse.Fill> <ImageBrush ImageSource="YourImage.png"/> </Ellipse.Fill> </Ellipse> 回答2: My idea is very simple: <Image Source="ImagePath" Width="326" Height="188"> <Image.Clip>

How to make a squared image to a round image on Windows Phone

好久不见. 提交于 2020-12-29 03:23:05
问题 how is it possible to make a round image on Windows Phone of a squared image. I have a lot of images which should be displayed as a circle. But how can I do this? Thank. 回答1: In XAML you want to make the circle using an Ellipse control. Then give it an ImageBrush fill. <Ellipse Height="100" Width="100"> <Ellipse.Fill> <ImageBrush ImageSource="YourImage.png"/> </Ellipse.Fill> </Ellipse> 回答2: My idea is very simple: <Image Source="ImagePath" Width="326" Height="188"> <Image.Clip>

Default Constructor Parameter in MarkupExtension declaration

一笑奈何 提交于 2020-12-28 18:24:18
问题 Reducing this question to the bare minimum, consider this MarkupExtension class... public class ProblemStatement : MarkupExtension { private readonly string _first; private readonly string _second; public ProblemStatement(string first, string second) { _first = first; _second = second; } public override object ProvideValue(IServiceProvider serviceProvider) { return this; } public override string ToString() { return _first + _second; } } When this Xaml is declared... <Grid> <TextBlock Name=

How to use Font Awesome icons in project as an icon of ImageButton

我们两清 提交于 2020-12-26 12:14:40
问题 I am having a problem to realize how to use Font Awesome icons in my Xamarin application, I want to use it with ImageButton as icon. And most tutorials I found didn't help me understand how it works. 回答1: As explained in Microsoft Documentation: You need to first to have the font file I believe .ttf (or .otf). Add it to your shared project. Right click on the file and click on "properties", then set it build action to Embedded Resource . Export it with a friendly alias name in your

Changing The Background Of SelectedItem In WPF ListBox

烂漫一生 提交于 2020-12-26 11:04:38
问题 This question has been asked & answered on here about a dozen times, but none of the given answers seem to work. The question: In a WPF ListBox, how do you change the highlight color (of the selected item, and/or the 'mouseover' item)? This does not work (per here) - the highlight remains as default: <StackPanel> <StackPanel.Resources> <Style x:Key="ListBoxSelectedItemsStyle" TargetType="{x:Type ListBoxItem}"> <Style.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}

Center align toolbar items in Xamarin Forms

好久不见. 提交于 2020-12-25 18:01:54
问题 I have a content page with toolbar added as follows ContentPage [XamlCompilation(XamlCompilationOptions.Compile)] public partial class ChartList : ContentPage { public ChartList () { InitializeComponent (); //public class ToolbarItem : MenuItem ToolbarItem settings = new ToolbarItem { Icon = "icon.png", Text = "Settings", Command = new Command(this.ShowHomePage), }; this.ToolbarItems.Add(settings); } private void ShowHomePage() { this.Navigation.PushAsync(new MainPage()); } } App.Xaml.cs

Moving MainWindow.xaml

僤鯓⒐⒋嵵緔 提交于 2020-12-25 07:05:32
问题 I've built a WPF app, which completely works now. However, to clean it up a bit I wish to move my MainWindow.xaml to the view folder I've created. After I've done this the application won't run and it gives me an "Unknown build error" which doesn't give any info on how to fix it... What should I change in my MainWindow.xaml to let the app work properly again? I've already changed <Window x:Class="projectname.MainWindow"> to <Window x:Class="projectname.view.MainWindow"> Should I change other

Moving MainWindow.xaml

早过忘川 提交于 2020-12-25 07:00:40
问题 I've built a WPF app, which completely works now. However, to clean it up a bit I wish to move my MainWindow.xaml to the view folder I've created. After I've done this the application won't run and it gives me an "Unknown build error" which doesn't give any info on how to fix it... What should I change in my MainWindow.xaml to let the app work properly again? I've already changed <Window x:Class="projectname.MainWindow"> to <Window x:Class="projectname.view.MainWindow"> Should I change other

Moving MainWindow.xaml

扶醉桌前 提交于 2020-12-25 07:00:34
问题 I've built a WPF app, which completely works now. However, to clean it up a bit I wish to move my MainWindow.xaml to the view folder I've created. After I've done this the application won't run and it gives me an "Unknown build error" which doesn't give any info on how to fix it... What should I change in my MainWindow.xaml to let the app work properly again? I've already changed <Window x:Class="projectname.MainWindow"> to <Window x:Class="projectname.view.MainWindow"> Should I change other