Hỏi đáp

Chia sẻ kiến thức, cùng nhau phát triển

Hỏi về colour zone trong material design

13:47 21-07-2022 582 lượt xem 3 bình luận

Chào anh Long và mọi người, em đang làm khóa luận tốt nghiệp về 1 phần mềm quản lý, em có thiết kế giao diện bằng materialdesign như trong series Phần mềm quản lý kho mà anh đã hướng dẫn thì em thay controlbar bằng ColourZone của materialdesign. Anh cho em hỏi: Làm sao để khi nhấn vào togglebutton của ColourZone thì nó hiện ra menu? Em có tìm trên mạng hoài mà không được. Xin anh và mọi người có thể giúp đỡ em. Em cảm ơn anh

 

Bình luận

Để bình luận, bạn cần đăng nhập bằng tài khoản Howkteam.

Đăng nhập
Vo Tan Duc đã bình luận 17:24 23-07-2022
<UserControl x:Class="CoffeeShopMangement.ControlBarUC"
             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:CoffeeShopMangement"
			 xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             mc:Ignorable="d" 
			 xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
			 x:Name="ucControlBar">
	<UserControl.Resources>
		
	</UserControl.Resources>
	<i:Interaction.Triggers>
		<i:EventTrigger EventName="MouseLeftButtonDown">
			<i:InvokeCommandAction Command="{Binding MouseLeftButtonDownCommand}" CommandParameter="{Binding ElementName=ucControlBar}"/>
		</i:EventTrigger>
	</i:Interaction.Triggers>
	<Grid>
		<materialDesign:ColorZone Mode="PrimaryLight">
			<DockPanel>
				<StackPanel DockPanel.Dock="Right" Background="Transparent" Orientation="Horizontal">
					<Button ToolTip="Thu nhỏ" Content="{materialDesign:PackIcon Kind=WindowMinimize}" Command="{Binding MinimizeWindowCommand}" CommandParameter="{Binding ElementName=ucControlBar}" Background="LightGreen" />
					<Button Command="{Binding MaximizeWindowCommand}" CommandParameter="{Binding ElementName=ucControlBar}" ToolTip="Phóng to" Content="{materialDesign:PackIcon Kind=WindowMaximize}" Background="LightCoral" />
					<Button Command="{Binding CloseWindowCommand}" CommandParameter="{Binding ElementName=ucControlBar}" ToolTip="Đóng" ToolBar.OverflowMode="AsNeeded" Content="{materialDesign:PackIcon Kind=WindowClose}" Background="SeaGreen" />
				</StackPanel>
				<StackPanel DockPanel.Dock="Left" Orientation="Horizontal">
					<ToggleButton x:Name="ButtonOpenMenu" Style="{DynamicResource MaterialDesignHamburgerToggleButton}"></ToggleButton>
					<TextBlock VerticalAlignment="Center" Margin="16 0 0 0" Text="{Binding Tag, ElementName=ucControlBar}" />
				</StackPanel>
			</DockPanel>
		</materialDesign:ColorZone>
	</Grid>
</UserControl>

Mình đã tìm trên mạng rồi nhưng chỉ hướng dẫn làm sao tạo ra Hambuger Navigation Drawer chứ không có kết hợp với color zone của material design. Bạn có thể giúp mình được không? Cảm ơn bạn

Cu Xin Author đã bình luận 00:20 23-07-2022

Dùng Drawer materialdesign kết hợp nhé bạn

Câu hỏi mới nhất