Xin chào tất cả các bạn đã ghé qua trang của mình, hôm nay mình sẽ hướng dẫn các bạn code giao diện quản lý bằng WPF C#.
Rất mong các bạn ủng hộ mình giúp để giúp mình có thêm động lực phát triển kênh lập trình C# căn bản để mọi người có nơi cùng nhau trao đổi, học hỏi kình nghiệm và có thêm nhiều kiến thức bổ ích.
+) Hướng dẫn View Main.
<Window x:Class="Page_Navigation_App.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:vm="clr-namespace:Page_Navigation_App.ViewModel"
xmlns:Menu="clr-namespace:Page_Navigation_App.Utilities"
mc:Ignorable="d"
Title="MainWindow"
Height="600"
Width="850"
AllowsTransparency="True"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
Background="Transparent">
<Window.DataContext>
<vm:NavigationVM />
</Window.DataContext>
<Grid>
<!--// Window Border //-->
<Border Background="#212529"
CornerRadius="20" />
<Grid>
<!--// Base Grid //-->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="228" />
<ColumnDefinition Width="622" />
</Grid.ColumnDefinitions>
<!--// Navigation Panel //-->
<Grid HorizontalAlignment="Left"
Width="228">
<Border Background="#272B2F"
CornerRadius="20,0,0,20" />
<StackPanel Height="400"
Width="228">
<!--// Home //-->
<Menu:Btn Style="{StaticResource BtnStyle}"
Command="{Binding HomeCommand}"
IsChecked="True">
<Grid>
<Image Source="Images/img_home.png"
Style="{StaticResource Image_Style}" />
<TextBlock Text="Home"
Style="{StaticResource Text_Style}" />
</Grid>
</Menu:Btn>
<!--// Customer //-->
<Menu:Btn Style="{StaticResource BtnStyle}"
Command="{Binding CustomersCommand}">
<Grid>
<Image Source="Images/img_customer.png"
Style="{StaticResource Image_Style}" />
<TextBlock Text="Customer"
Style="{StaticResource Text_Style}" />
</Grid>
</Menu:Btn>
<!--// Products //-->
<Menu:Btn Style="{StaticResource BtnStyle}"
Command="{Binding ProductsCommand}">
<Grid>
<Image Source="Images/img_product.png"
Style="{StaticResource Image_Style}" />
<TextBlock Text="Products"
Style="{StaticResource Text_Style}" />
</Grid>
</Menu:Btn>
<!--// Orders //-->
<Menu:Btn Style="{StaticResource BtnStyle}"
Command="{Binding OrdersCommand}">
<Grid>
<Image Source="Images/img_order.png"
Style="{StaticResource Image_Style}" />
<TextBlock Text="Orders"
Style="{StaticResource Text_Style}" />
</Grid>
</Menu:Btn>
<!--// Transactions //-->
<Menu:Btn Style="{StaticResource BtnStyle}"
Command="{Binding TransactionsCommand}">
<Grid>
<Image Source="Images/img_transaction.png"
Style="{StaticResource Image_Style}" />
<TextBlock Text="Transactions"
Style="{StaticResource Text_Style}" />
</Grid>
</Menu:Btn>
<!--// Shipments //-->
<Menu:Btn Style="{StaticResource BtnStyle}"
Command="{Binding ShipmentsCommand}">
<Grid>
<Image Source="Images/img_shipment.png"
Style="{StaticResource Image_Style}" />
<TextBlock Text="Shipments"
Style="{StaticResource Text_Style}" />
</Grid>
</Menu:Btn>
<!--// Settings //-->
<Menu:Btn Style="{StaticResource BtnStyle}"
Command="{Binding SettingsCommand}">
<Grid>
<Image Source="Images/img_setting.png"
Style="{StaticResource Image_Style}" />
<TextBlock Text="Settings"
Style="{StaticResource Text_Style}" />
</Grid>
</Menu:Btn>
</StackPanel>
</Grid>
<Grid Grid.Column="1">
<ContentControl x:Name="Pages"
Content="{Binding CurrentView}" />
</Grid>
</Grid>
<Button x:Name="CloseApp"
Style="{StaticResource ExitApp}"
Click="CloseApp_Click" />
</Grid>
</Window>
Tải source tại đây.
Cảm ơn các bạn đã ghé trang. ( ^ . ^ )