一、界面内容(部分:仅供参考)

<Window>
    <Window.Resources>

        <!--工具数据源-->
        <XmlDataProvider x:Key="toolsDS" Source="Config\Tools\Tools.xml" XPath="Tools/Tool"></XmlDataProvider>
        <!--Tool模板-->
        <HierarchicalDataTemplate DataType="Tool" ItemsSource="{Binding XPath=Tool}" >
            <StackPanel  Orientation="Vertical" VerticalAlignment="Center" Margin="0,10,0,0"   > <!--MouseEnter="MenuItemImage_MouseEnter"  MouseLeave="MenuItemImage_MouseLeave"-->
                <TextBlock Tag ="{Binding XPath=@Name}" Width="38" Height="38" Margin="0,0,0,0" VerticalAlignment="Center" >
                <Image  x:Name="img_menuIcon" MouseEnter="MenuItemImage_MouseEnter"  MouseLeave="MenuItemImage_MouseLeave"   Source="{Binding XPath=@ImagePath0}"   ><!--Width="38" Height="38"--></Image>
                </TextBlock>
                <TextBlock x:Name="img_Title" Text ="{Binding XPath=@Title}" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" Margin="0,3,0,0" Foreground="#FFD1D1D1" FontSize="{Binding XPath=@FontSize}" MouseEnter="MenuItemText_MouseEnter"  MouseLeave="MenuItemText_MouseLeave"  >
                </TextBlock>
            </StackPanel>
        </HierarchicalDataTemplate>


    </Window.Resources>


    <StackPanel x:Name="StackBlist" Orientation="Vertical" MenuItem.Click="MenuItem_Click"   VerticalAlignment="Top" Background="#43464f">
        <Button x:Name="btnOS" Click="btnOS_Click" Width="88" Height="26" Margin="-2,-2,-2,0" Background="#FF939393" BorderBrush="{x:Null}" Foreground="{x:Null}" BorderThickness="0"
                    PreviewMouseLeftButtonDown="StackBlist_PreviewMouseLeftButtonDown"
                    PreviewMouseLeftButtonUp="StackBlist_PreviewMouseLeftButtonUp" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{x:Null}" IsEnabled="True" IsHitTestVisible="True" IsManipulationEnabled="False">
                    <!--PreviewMouseMove="StackBlist_PreviewMouseMove"-->
            <Image x:Name="ImgOsCanvas" Source="/DrawTool;component/Images/铺展.png"  Height="20"></Image>

            <Button.Template>
                <ControlTemplate TargetType="Button">
                    <Grid Background="#939393">
                        <Image x:Name="ImgOsCanvas" Source="/DrawTool;component/Images/铺展.png" Width="88" Height="20"></Image>
                    </Grid>
                </ControlTemplate>

            </Button.Template>

        </Button>
        <!--<TextBlock Height="10" Margin="0,0,0,0" Background="#43464f">
        </TextBlock>-->
        <Menu x:Name="menuTools" ItemsSource="{Binding Source={StaticResource ResourceKey= toolsDS}}"  Background="Transparent" ></Menu>
         
    </StackPanel>
    
</Window>
View Code

相关文章:

  • 2022-12-23
  • 2021-09-22
  • 2022-02-20
  • 2021-12-02
  • 2018-10-27
  • 2022-02-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案