xaml

Trouble setting a DataTrigger in WPF

ε祈祈猫儿з 提交于 2020-02-03 05:13:13
问题 I have a ComboBox and a Button on my main view, and I want to apply a style to the button such that when the combobox index is set to 1, the button becomes visible (initially it's hidden). This is my XAML code: <Grid> <StackPanel Orientation="Vertical" Margin="10"> <ComboBox Name="comboBox"/> <Button Name="myBtn" Content="Hello" Visibility="Hidden"> <Button.Style> <Style TargetType="{x:Type Button}"> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=comboBox, Path=SelectedIndex}"

FlipView SelectionChanged event occurs only when touch manipulations are complete

主宰稳场 提交于 2020-02-03 04:05:26
问题 From the docs: Note When a user flips through FlipView content using touch interaction, a SelectionChanged event occurs only when touch manipulations are complete. This means that when a user flips through content quickly, individual SelectionChanged events are not always generated for every item because the manipulation is still occurring. Is there a way to configure the FlipView control to fire SelectionChanged for each flip? This behavior makes implementing paging interesting as the user,

少量代码设计一个登录界面 - .NET CORE(C#) WPF开发

隐身守侯 提交于 2020-02-02 18:13:45
微信公众号: Dotnet9 ,网站: Dotnet9 ,问题或建议: 请网站留言 , 如果对您有所帮助: 欢迎赞赏 。 少量代码设计一个登录界面 - .NET CORE(C#) WPF开发 阅读导航 本文背景 代码实现 本文参考 源码 1. 本文背景 继续 MaterialDesignThemes 开源控件库学习,本文简单使用输入控件的水印附加属性:materialDesign:HintAssist.Hint。 2. 代码实现 使用 .NET CORE 3.1 创建名为 “Login” 的WPF模板项目,添加1个Nuget库:MaterialDesignThemes.3.1.0-ci981。 解决方案主要文件目录组织结构: Login App.xaml MainWindow.xaml MainWindow.xaml.cs 2.1 App.xaml文件引入样式 文件【App.xaml】,在 StartupUri 中设置启动的视图【MainWindow.xaml】,并在【Application.Resources】节点增加 MaterialDesignThemes库的样式文件: <Application x:Class="Login.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns

WPF ContextMenu Design. How to set Background in WPF MenuItem?

▼魔方 西西 提交于 2020-02-02 13:21:07
问题 I create popup menu like this. <DockPanel.ContextMenu> <ContextMenu Background="#CD252220" Opacity="0.95" Foreground="LightGray" BorderBrush="DarkGray"> <MenuItem Header="_Save Image..." x:Name="btSave" IsEnabled="False" Click="btSave_Click" Style="{StaticResource MyStyle}"> <MenuItem.Icon> <Image Source="icons/save.png" Width="16" Height="16" Style="{StaticResource IconStyle}"/> </MenuItem.Icon> </MenuItem> </ContextMenu> </DockPanel.ContextMenu> Why left-side of this menu is WHITE????? It

WPF ContextMenu Design. How to set Background in WPF MenuItem?

不想你离开。 提交于 2020-02-02 13:19:28
问题 I create popup menu like this. <DockPanel.ContextMenu> <ContextMenu Background="#CD252220" Opacity="0.95" Foreground="LightGray" BorderBrush="DarkGray"> <MenuItem Header="_Save Image..." x:Name="btSave" IsEnabled="False" Click="btSave_Click" Style="{StaticResource MyStyle}"> <MenuItem.Icon> <Image Source="icons/save.png" Width="16" Height="16" Style="{StaticResource IconStyle}"/> </MenuItem.Icon> </MenuItem> </ContextMenu> </DockPanel.ContextMenu> Why left-side of this menu is WHITE????? It

Silverlight - binding a listbox within a listbox template

痴心易碎 提交于 2020-02-02 10:32:53
问题 In silverlight, I'm trying to build a listbox of reports and I'm trying to show the parameters of the report in a listbox within the datatemplate of the outer reports listbox. Here are the data classes: public class Report { public string Title { get; set; } public string Description { get; set; } public List<ReportParameter> Parameters = new List<ReportParameter>(); } public class ReportParameter { public string Name { get; set; } public string ParameterType { get; set; } public bool

How to insert XAML into RichTextBox?

房东的猫 提交于 2020-02-02 04:54:27
问题 A XAML text stored in database, how can I show its text in a RichTextBox after reading the XAML by XmlReader? StringReader stringReader = new StringReader(xamlString); XmlReader xmlReader = XmlReader.Create(stringReader); rt.Document = ??? ------UPDATE------------------- here is the xamlString contents: <Section xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve" TextAlignment="Left" LineHeight="Auto" IsHyphenationEnabled="False" xml:lang="en-us"

How to insert XAML into RichTextBox?

佐手、 提交于 2020-02-02 04:53:49
问题 A XAML text stored in database, how can I show its text in a RichTextBox after reading the XAML by XmlReader? StringReader stringReader = new StringReader(xamlString); XmlReader xmlReader = XmlReader.Create(stringReader); rt.Document = ??? ------UPDATE------------------- here is the xamlString contents: <Section xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve" TextAlignment="Left" LineHeight="Auto" IsHyphenationEnabled="False" xml:lang="en-us"

Can I disable ViewCell.ContextActions based on a condition

落爺英雄遲暮 提交于 2020-02-02 04:07:41
问题 Hi I using a Xamarin Forms ListView and I want to know if I can disable the Context Actions based on a certain binding or in the code behind. I am using one GroupedListView for the whole application but it displays different data based on what the user is doing. There is a "Manage your Favorites" feature where I want the user to be able to swipe-to-delete on iOS or long-press on android to remove a ListItem, but I do not want this behavior if the list is displaying some search result or

Can I disable ViewCell.ContextActions based on a condition

安稳与你 提交于 2020-02-02 04:06:39
问题 Hi I using a Xamarin Forms ListView and I want to know if I can disable the Context Actions based on a certain binding or in the code behind. I am using one GroupedListView for the whole application but it displays different data based on what the user is doing. There is a "Manage your Favorites" feature where I want the user to be able to swipe-to-delete on iOS or long-press on android to remove a ListItem, but I do not want this behavior if the list is displaying some search result or