xaml

WPF databinding to interface cannot find property

不问归期 提交于 2021-02-11 13:12:11
问题 I am working from the solution presented here, which has worked well for me until this point. I'm now trying to perform datatrigger binding to an interface property via the following XAML: <DataGrid.RowStyle> <Style TargetType="{x:Type DataGridRow}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=(selection:IChartDefinitionViewModel.SelectedItem).HasErrors}" Value="False"> <Setter Property="Background" Value="Transparent"/> </DataTrigger> <DataTrigger Binding="{Binding Path=(selection

WPF DataGrid ComboBox SelectedItem Property Setter

心已入冬 提交于 2021-02-11 13:00:12
问题 I am looking for an example of how to use the SelectedItem property inside a combobox in a WPF DataGrid, I have <DataGridComboBoxColumn SelectedValueBinding="{Binding CID, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" SelectedValuePath="CID" Header="CID" Width="70"> <DataGridComboBoxColumn.EditingElementStyle> <Style TargetType="ComboBox"> <Setter Property="ItemsSource" Value="{Binding DataContext.ListCustomerCollection, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType

WPF DataGrid ComboBox SelectedItem Property Setter

和自甴很熟 提交于 2021-02-11 12:58:49
问题 I am looking for an example of how to use the SelectedItem property inside a combobox in a WPF DataGrid, I have <DataGridComboBoxColumn SelectedValueBinding="{Binding CID, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" SelectedValuePath="CID" Header="CID" Width="70"> <DataGridComboBoxColumn.EditingElementStyle> <Style TargetType="ComboBox"> <Setter Property="ItemsSource" Value="{Binding DataContext.ListCustomerCollection, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType

Defining Shell.TitleView while preserving the title text of tabs in shell, but seems showing in a different font

心不动则不痛 提交于 2021-02-11 12:38:15
问题 I am defining a custom Shell.TitleView in a way to preserve the Tab/Page title of my ContentPage as follow: <Shell.TitleView> <Label Text="Page2" FontSize="20" VerticalTextAlignment="Center"/> <!-- rest of my TitleView irrelevant in this question--> </Shell.TitleView> The issue here is that the generated title by the default Shell.TitleView (in the second Tab) is different from mine (the difference is more noticeable when you navigate from one tab to the other than in screenshots), at first I

Defining Shell.TitleView while preserving the title text of tabs in shell, but seems showing in a different font

岁酱吖の 提交于 2021-02-11 12:37:50
问题 I am defining a custom Shell.TitleView in a way to preserve the Tab/Page title of my ContentPage as follow: <Shell.TitleView> <Label Text="Page2" FontSize="20" VerticalTextAlignment="Center"/> <!-- rest of my TitleView irrelevant in this question--> </Shell.TitleView> The issue here is that the generated title by the default Shell.TitleView (in the second Tab) is different from mine (the difference is more noticeable when you navigate from one tab to the other than in screenshots), at first I

WPF How to display relational data in DataGrid's TextBlock like in ComboBox

白昼怎懂夜的黑 提交于 2021-02-11 12:32:13
问题 When searching for help on this topic, I typically find information on how to populate a ComboBox with related data (display name in one table for the foreign key in originating table), but I am already able to do that. I am looking for a solution on how to achieve the same result in a TextBlock. In my project I have created a link to an SQL database using EntityFramework. There are two tables: Personnel and Role. They are related with Personnel.RoleIdFk and Role.RoleId. I am able to get a

why does x:Bind expect a static method to bind to?

混江龙づ霸主 提交于 2021-02-11 12:22:35
问题 I have a UWP MVVM application where I bind, amongst others, the following property to a DataGridComboBoxColumn : public List<ComboBoxValues> ListValues { get; set; } = new List<ComboBoxValues>(); XAML: xmlns:local="using:MyProject.ViewModels" <controls:DataGridComboBoxColumn Header="myHeader" Binding="{Binding theSelectedValue, Mode=TwoWay}" ItemsSource="{x:Bind local:PageVM.ListValues, Mode=OneWay}" DisplayMemberPath="theValueOptions"/> I use dependency injection, using Autofac to generate

Is there any way to create a sticky footer in xaml?

Deadly 提交于 2021-02-11 07:31:00
问题 I know you can do a sticky footer in css, is there any way to do it in xaml? Or to use css in xaml to do the same thing? I'm brand new to xaml, so any help would be appreciated. 回答1: It can be done using DockPanels. 回答2: I'd opt for a Grid as I find them easier to extend if your layout changes or you add more controls: <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions>

How to bind one texblock value to other textblock one way and get value in MVVM

筅森魡賤 提交于 2021-02-11 07:04:10
问题 Let me explain my question by an Image I have MVVM structure in My project. I have two textblocks, Textblock 1 and textblock 2 . Now I want textblock2's Text same as Textblock1's Text, whenever Textblock1's Text changed. but I should be able to set Textblock2's Text different from Textblock1's . So I am setting Oneway binding of Textblock1's Text Property. How Can I get the Text property of Textblock2's In MVVM. If I create a property for Textblock2's Text property, I wont be able to bind

How to bind one texblock value to other textblock one way and get value in MVVM

扶醉桌前 提交于 2021-02-11 07:02:40
问题 Let me explain my question by an Image I have MVVM structure in My project. I have two textblocks, Textblock 1 and textblock 2 . Now I want textblock2's Text same as Textblock1's Text, whenever Textblock1's Text changed. but I should be able to set Textblock2's Text different from Textblock1's . So I am setting Oneway binding of Textblock1's Text Property. How Can I get the Text property of Textblock2's In MVVM. If I create a property for Textblock2's Text property, I wont be able to bind