Created
December 5, 2016 19:06
-
-
Save FoggyFinder/b15c349c46ff40105213956cbd651269 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:fsxaml="http://github.com/fsprojects/FsXaml" | |
Title="MVVM and XAML Type provider" | |
Width="400" | |
Height="200"> | |
<Grid> | |
<Grid> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="Auto" /> | |
<RowDefinition Height="*" /> | |
</Grid.RowDefinitions> | |
<Button HorizontalAlignment="Center" | |
Command="{Binding CreateCommand}" | |
Content="Create" /> | |
<DataGrid Grid.Row="1" | |
AutoGenerateColumns="False" | |
ItemsSource="{Binding Model}"> | |
<DataGrid.Columns> | |
<DataGridTextColumn Width="*" | |
Binding="{Binding .}" | |
Header="Value" /> | |
<DataGridTemplateColumn Width="Auto" Header="+"> | |
<DataGridTemplateColumn.CellTemplate> | |
<DataTemplate> | |
<Button MinWidth="50" | |
MaxWidth="50" | |
Command="{Binding RelativeSource={RelativeSource FindAncestor, | |
AncestorType={x:Type DataGrid}}, | |
Path=DataContext.Up}" | |
CommandParameter="{Binding RelativeSource={RelativeSource Self}, | |
Path=DataContext}" | |
Content="^" /> | |
</DataTemplate> | |
</DataGridTemplateColumn.CellTemplate> | |
</DataGridTemplateColumn> | |
</DataGrid.Columns> | |
</DataGrid> | |
</Grid> | |
</Grid> | |
</Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment