xaml

How can I use a collection on the data item row of my Windows Community Template datagrid as the Itemsource for a ComboBox column on the same row?

随声附和 提交于 2021-02-11 14:56:33
问题 How can I bind the ItemsSource of a Combobox column to a collection that is a sub-property of a property on the same row? In other words, the DataGrid is bound to a collection of items of a class the contains Property1 and Property2. So the DataGrid has two columns, Property1 and Property2. Property1 has a sub-property that is an Observable Collection. The column for Property2 is a Combobox column that should use Property1's Observable Collection as its ItemsSource. I'm loading the grid's

How to give Data trigger property for custom usercontrol?

南笙酒味 提交于 2021-02-11 14:55:28
问题 I have created the custom usercontrol for datagrid as CustomDatagrid. And i am using that custom datagrid in another usercontrol as DatagridUserControl. I added Textblock inside the CustomDatagrid in DatagridUserControl. I gave x:Name for Textblock in DatagridUserControl. <GridControl:CustomDatagrid Grid.Row="2" Height="260" Width="640" x:Name="GridTask" BorderThickness="0" FontSize="24" Foreground="White" SelectionChanged="slmGridTask_SelectionChanged" ColumnWidth="*" CanUserResizeColumns=

How to use vertical Scroll view to show binding data

ⅰ亾dé卋堺 提交于 2021-02-11 14:45:16
问题 I want a structure like this : Click this to see the desired output But with my code i'm getting this : Click this to see the output Here is my xaml code : <ScrollView Orientation="Horizontal"> <StackLayout Orientation="Horizontal" VerticalOptions="Start"> <Grid x:Name="ImagesListViews" > <Grid.RowDefinitions> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> </Grid> <local:BindableStackLayout x:Name=

get parent-note in treeview when the child-items are the same object

耗尽温柔 提交于 2021-02-11 14:21:43
问题 i have a TreeView with same in xaml createt TreeViewItems. And one note has a ObservableCollection as ItemSource. This works like a Charm. But now i want same Notes to every item of the list (for better organization). So i do this: This is my HierarchicalDataTemplate for the liste <HierarchicalDataTemplate DataType="{x:Type classes:Connection}" ItemsSource="{Binding Source={StaticResource ConnectionChilds}}" > <TextBlock Text="{Binding DisplayName}" /> </HierarchicalDataTemplate> And the

Can't get GetPositionFromPoint to work well (WPF, C#)

我的未来我决定 提交于 2021-02-11 14:19:37
问题 I am trying to use the GetPositionFromPoint, and in the documentation it talks about the snapToText bool which, if false, "returns null if point is not inside a character's bounding box" . Anyway, I am receiving always a null TextPointer, even when my Point is on a character. I leave my code here, I am using a checkbox (called "check") to see if the TextPointer is null or not, and it is always unchecked: Point posicion = Mouse.GetPosition(Application.Current.MainWindow); TextPointer posAhora

UWP - How Can Dispatcher DispatchedHandler Run On Worker Thread?

你。 提交于 2021-02-11 14:17:03
问题 Im trying to update some UWP UI from a background thread via the Dispatcher. However, the handler passwed to the RunAsync method is still getting executed on a backlground thread. I have no idea how to fix this - have I missed something? --EDIT-- I only have one window, which is Window.Current I have tried the Community Toolkit DispatcherHelper class, but I'm still getting the exact same exception private static async void OnSelectedItemChanged(DependencyObject d,

Configuring dynamic headers for a WPF TabControl

牧云@^-^@ 提交于 2021-02-11 14:00:36
问题 I am trying to make a basic window that uses a WPF TabControl to allow users to add new tabs. I want the end product to look somewhat like the way tabs work in a web browser where the last tab is just a "+" that when clicked it will add a new tab. I am trying to write the XAML code to set this up and I found that I can specify multiple DataTemplates within "TabControl.Resources" and based on the "DataType" the correct DataTemplate will be used to display the correct view for each tab... but

WPF INotifyDataErrorInfo highlight ListBoxItem

偶尔善良 提交于 2021-02-11 13:49:13
问题 I've got a ListBox as such: <ListBox Margin="5" ItemsSource="{Binding NetworkAdapters, Mode=OneWay}" SelectedItem="{Binding SelectedNetworkAdapter}" SelectionChanged="{s:Action SelectedNetworkAdapterChanged}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Columns="2" VerticalAlignment="Top"/> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Ellipse Width="15" Height="15" Margin="5"> <Ellipse.Style> <Style

WPF databinding to interface cannot find property

五迷三道 提交于 2021-02-11 13:14:24
问题 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 databinding to interface cannot find property

浪尽此生 提交于 2021-02-11 13:12:35
问题 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