123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <cc:WaaaghWindow x:Class="WpfSample.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:WpfSample"
- xmlns:vm="clr-namespace:WpfSample.ViewModels"
- xmlns:attach="clr-namespace:Waaagh.Behaviors;assembly=Waaagh"
- xmlns:cc="clr-namespace:Waaagh.CustomControl;assembly=Waaagh"
- xmlns:james="https://jamesnet.dev/xaml/presentation"
- mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="800">
- <Window.DataContext>
- <vm:MainViewModel/>
- </Window.DataContext>
- <TabControl>
- <TabItem Header="TEst">
- <cc:NavigationBar>
- <ListBoxItem Content="Microsoft" Tag="{x:Static james:IconType.Microsoft}"/>
- <ListBoxItem Content="Apple" Tag="{x:Static james:IconType.Apple}"/>
- <ListBoxItem Content="Google" Tag="{x:Static james:IconType.Google}"/>
- <ListBoxItem Content="Facebook" Tag="{x:Static james:IconType.Facebook}"/>
- <ListBoxItem Content="Instagram" Tag="{x:Static james:IconType.Instagram}"/>
- </cc:NavigationBar>
- </TabItem>
- <TabItem Header="Animation">
- <Rectangle x:Name="TestRectangle" Width="100" Height="100" Fill="Coral">
- <Rectangle.Triggers>
- <EventTrigger RoutedEvent="Rectangle.Loaded">
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="TestRectangle" Storyboard.TargetProperty="Opacity"
- Duration="0:0:2" From="1.0" To="0.0" AutoReverse="True" RepeatBehavior="Forever"/>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </Rectangle.Triggers>
- </Rectangle>
- </TabItem>
- <TabItem Header="WaaaghTheme">
- <Grid ShowGridLines="True">
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="32"/>
- </Grid.RowDefinitions>
- <Border Grid.Row="0" Background="{DynamicResource BackgroundBrush}">
- <TextBlock FontSize="32" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Greeting" Foreground="{DynamicResource ForegroundBrush}"/>
- </Border>
- <StackPanel Grid.Row="1" Orientation="Horizontal">
- <Button Content="Dark" Click="DarkThemeButton_Click"/>
- <Button Content="Light" Click="LightThemeButton_Click"/>
- </StackPanel>
- </Grid>
- </TabItem>
- <TabItem Header="ItemsDraggable">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="36"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <StackPanel Grid.Row="0" Orientation="Horizontal">
- <Button Command="{Binding AddGroupCommand}" Content="AddGroup"/>
- <Button Command="{Binding AddItemCommand}" Content="AddItem"/>
- </StackPanel>
- <UniformGrid Grid.Row="1" Columns="4">
- <UniformGrid.Resources>
- <HierarchicalDataTemplate DataType="{x:Type vm:DemoGroupViewModel}" ItemsSource="{Binding Items}">
- <Border Background="Coral">
- <TextBlock>
- <TextBlock.Text>
- <MultiBinding StringFormat="{}{0}-{1}">
- <Binding Path="Index"/>
- <Binding Path="Name"/>
- </MultiBinding>
- </TextBlock.Text>
- </TextBlock>
- </Border>
- </HierarchicalDataTemplate>
- <HierarchicalDataTemplate DataType="{x:Type vm:DemoItemViewModel}">
- <Border Background="#669999">
- <TextBlock Text="{Binding Message}"/>
- </Border>
- </HierarchicalDataTemplate>
- </UniformGrid.Resources>
- <TreeView ItemsSource="{Binding Groups}"
- attach:ItemsDraggable.Enabled="True"
- attach:ItemsDraggable.DoMoveEffect="{Binding DoMoveEffectFunc}"/>
- <TreeView ItemsSource="{Binding Groups}"
- attach:ItemsDraggable.Enabled="True"
- attach:ItemsDraggable.DoMoveEffect="{Binding DoMoveEffectFunc}"/>
- <TreeView ItemsSource="{Binding Groups2}"
- attach:ItemsDraggable.Enabled="True"
- attach:ItemsDraggable.DoMoveEffect="{Binding DoMoveEffectFunc}"/>
- <TreeView ItemsSource="{Binding Groups2}"
- attach:ItemsDraggable.Enabled="True"
- attach:ItemsDraggable.DoMoveEffect="{Binding DoMoveEffectFunc}"/>
- </UniformGrid>
- </Grid>
- </TabItem>
- </TabControl>
- </cc:WaaaghWindow>
|