Add project files.

This commit is contained in:
Mark Kors
2025-11-12 15:16:52 +01:00
parent 46b69812a0
commit fe6e2cfcff
9 changed files with 242 additions and 0 deletions

45
Views/MainWindow.xaml Normal file
View File

@@ -0,0 +1,45 @@
<Window x:Class="MVVM_DEMO.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MVVM_DEMO"
xmlns:vm="clr-namespace:MVVM_DEMO.ViewModels"
mc:Ignorable="d"
Title="MainWindow"
Height="450"
Width="800">
<Window.DataContext>
<vm:MainViewModel />
</Window.DataContext>
<Grid>
<StackPanel>
<ComboBox x:Name="comboBox"
Width="200"
Height="30"
Margin="10"
VerticalAlignment="Top"
ItemsSource="{Binding Products}"
DisplayMemberPath="ProductName" />
<Button x:Name="btnAddProduct"
Content="Add Product"
Width="100px"
Height="25px"
Click="btnAddProduct_Click" />
<Label Content="Selected Product Details"
FontWeight="Bold"
FontSize="16"
Margin="10" />
<TextBox x:Name="txtProductName"
Width="200"
Height="30"
Text="{Binding productName}"
/>
<TextBox x:Name="txtProductPrice"
Width="200"
Height="30"
Text="{Binding productPrice}" />
</StackPanel>
</Grid>
</Window>