Repository navigation
Expand file tree
/
Copy pathAddEditPage.xaml
More file actions
95 lines (88 loc) · 4.69 KB
/
Copy pathAddEditPage.xaml
File metadata and controls
95 lines (88 loc) · 4.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<Page x:Class="kurs.AddEditPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:kurs"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
Background="{DynamicResource MaterialDesignPaper}"
TextElement.FontWeight="Medium"
TextElement.FontSize="14"
FontFamily="{materialDesign:MaterialDesignFont}"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="800"
Title="AddEditPage">
<Grid>
<Grid.Resources>
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource MaterialDesignTextBlock}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignOutlinedTextBox}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="20 0"/>
</Style>
<Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource MaterialDesignOutlinedComboBox}">
<Setter Property="Margin" Value="20 0"/>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="4*"></RowDefinition>
<RowDefinition Height="2*"></RowDefinition>
<RowDefinition Height="2*"></RowDefinition>
<RowDefinition Height="4*"></RowDefinition>
<RowDefinition Height="4*"></RowDefinition>
<RowDefinition Height="2*"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock Text="Cat" Grid.Row="0"></TextBlock>
<Grid Grid.Row="0" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<ComboBox materialDesign:HintAssist.Hint="Select category" SelectedItem="{Binding category}"
x:Name="comboCategory" Grid.Column="0"
HorizontalAlignment="Left" Width="Auto" DisplayMemberPath="name"/>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Separator Width="2" Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
<Label Content="Image"></Label>
<Image x:Name="ProductImage" Width="130" Margin="10 10 10 10"
Stretch="UniformToFill" HorizontalAlignment="Left" >
<Image.Source>
<Binding Path ="image">
<Binding.TargetNullValue>
<ImageSource>/Resources/no_image.png</ImageSource>
</Binding.TargetNullValue>
</Binding>
</Image.Source>
</Image>
<Button x:Name="BtnUploadImg" Content="Open file" Click="BtnUploadImg_Click"></Button>
</StackPanel>
</Grid>
<TextBlock Text="Name" Grid.Row="1"/>
<TextBox materialDesign:HintAssist.Hint="Name" Text="{Binding name}" Grid.Row="1" Grid.Column="1"></TextBox>
<TextBlock Text="Price" Grid.Row="2"></TextBlock>
<TextBox materialDesign:HintAssist.Hint="Price" Text="{Binding price}" Grid.Row="2" Grid.Column="1"></TextBox>
<TextBlock Text="Desc" Grid.Row="3"></TextBlock>
<TextBox Grid.Row="3" Grid.Column="1"
Text="{Binding description}"
Height="Auto"
AcceptsReturn="True" AcceptsTab="True"
materialDesign:HintAssist.Hint="Description"
></TextBox>
<TextBlock Grid.Row="4" Text="Json"></TextBlock>
<TextBox Grid.Row="4" Grid.Column="1"
Text="{Binding specifications_json}"
FontFamily="Consolas"
Height="Auto"
AcceptsReturn="True" AcceptsTab="True"
materialDesign:HintAssist.Hint="Json"
></TextBox>
<Button x:Name="btnSave" Grid.Row="5" Content="Save" Grid.Column="1" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="200" Height="40" Click="BtnSave_Click"/>
</Grid>
</Page>