当前位置: 首页 > news >正文

WPF 简洁的主界面

用的是dev的TileLayouotControl控件。

 <dxwui:PageAdornerControl Header="" Padding="30" ShowBackButton="False"  >
        <WrapPanel>
            <dxlc:TileLayoutControl Padding="12,0,10,10">

                <dxlc:Tile Header="重绕" Style="{StaticResource VerticalTile}" Background="#FF00ABDC"   dxwuin:Navigation.NavigateTo="ICMORpt">
                    <BitmapImage UriSource="/Images/UserManagment.png" />
                </dxlc:Tile>
                <!--dxlc:FlowLayoutControl.IsFlowBreak="True"-->
                <dxlc:Tile Header="装箱" Style="{StaticResource VerticalTile}"  Background="#FF6652A2"  dxwuin:Navigation.NavigateTo="Package">
                    <BitmapImage UriSource="/Images/Statistics.png" />
                </dxlc:Tile>

                <dxlc:Tile Header="装托" Style="{StaticResource HorizontalTile}" Background="#FFDA8515"  dxwuin:Navigation.NavigateTo="Pallet">
                    <BitmapImage UriSource="/Images/ZillowLogo.png" />
                </dxlc:Tile>

                <dxmvvm:Interaction.Behaviors>
                    <dxwuin:FrameDocumentUIService ShowSplashScreen="True" >
                        <dxwuin:FrameDocumentUIService.SplashScreenService>
                            <dx:DXSplashScreenService x:Name="WaitScreenService" ViewTemplate="{StaticResource waitIndicator}" SplashScreenStartupLocation="CenterOwner" />
                        </dxwuin:FrameDocumentUIService.SplashScreenService>
                    </dxwuin:FrameDocumentUIService>
                </dxmvvm:Interaction.Behaviors>
            </dxlc:TileLayoutControl>
            <dxlc:TileLayoutControl Padding="12,0,10,10">

                <dxlc:Tile Header="补打外箱标签" Style="{StaticResource VerticalTile}" Background="#FF00ABDC"   dxwuin:Navigation.NavigateTo="RePackagePrint">
                    <BitmapImage UriSource="/Images/UserManagment.png" />
                </dxlc:Tile>
               
                <dxmvvm:Interaction.Behaviors>
                    <dxwuin:FrameDocumentUIService ShowSplashScreen="True" >
                        <dxwuin:FrameDocumentUIService.SplashScreenService>
                            <dx:DXSplashScreenService x:Name="WaitScreenService1" ViewTemplate="{StaticResource waitIndicator}" SplashScreenStartupLocation="CenterOwner" />
                        </dxwuin:FrameDocumentUIService.SplashScreenService>
                    </dxwuin:FrameDocumentUIService>
                </dxmvvm:Interaction.Behaviors>
            </dxlc:TileLayoutControl>

            
        </WrapPanel>
       
    </dxwui:PageAdornerControl>

样式

  <UserControl.Resources>
        <DataTemplate x:Key="waitIndicator">
            <dx:WaitIndicator  DeferedVisibility="True"/>
        </DataTemplate>
        <converter:BatmapConverter x:Key="bitmapConverter"/>
        <converter:ModuleAuthVisibleConverter x:Key="moduleAuthConverter"/>
        <Style x:Key="VerticalTile" TargetType="{x:Type dxlc:Tile}">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Small" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate >
                        <StackPanel>
                            <dxe:ImageEdit IsReadOnly="True" Stretch="Fill"  EditValue="{Binding Mode=OneWay}" ShowBorder="False" Width="80" Height="80"/>
                            <TextBlock Text="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type dxlc:Tile}}}" FontSize="24" Margin="0,5,0,0" HorizontalAlignment="Center" 
                                FontFamily="宋体" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <Style x:Key="HorizontalTile" TargetType="{x:Type dxlc:Tile}">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Large" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <dxe:ImageEdit IsReadOnly="True" EditValue="{Binding Mode=OneWay}" Stretch="Fill"  ShowBorder="False" Width="80" Height="80"/>
                            <TextBlock Text="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type dxlc:Tile}}}" FontSize="24" Margin="20,0,0,0" VerticalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="FlatTile" TargetType="{x:Type dxlc:Tile}">
            <Setter Property="Size" Value="Large" />
            <Setter Property="Padding" Value="5" />
            <Setter Property="VerticalHeaderAlignment" Value="Stretch" />
        </Style>
        <help:Timer x:Key="time"/>

        <DataTemplate x:Key="layoutItemTemplate">
            <dxlc:Tile   Header="{Binding FNAME}" Style="{StaticResource VerticalTile}" Background="#FFA89BB6" 
                           dxwuin:Navigation.NavigateTo="CompleteReportView"  dxwuin:Navigation.NavigationParameter="{Binding}"   >
                <BitmapImage UriSource="/MESClient;component/Images/list.png" />
            </dxlc:Tile>
        </DataTemplate>

        <Style TargetType="dxwui:PageAdornerControl">
            <Setter Property="Padding" Value="0,-32,0,0" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="dxwui:PageAdornerControl">
                        <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                            <!--<Grid Margin="42,0,32,10">-->
                            <Grid >
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <Grid>
                                    <dxwuii:NavigationHeaderControl Margin="10,2,0,2" VerticalAlignment="Top" x:Name="PART_NavigationHeader" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"
                                        BackCommand="{TemplateBinding BackCommand}" ShowBackButton="{TemplateBinding ShowBackButton}" />
                                </Grid>
                                <ContentPresenter Grid.Row="1" Margin="{TemplateBinding Padding}" />
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <!--<TextBlock IsHitTestVisible="False" Text="返回" Foreground="#FFF78A09" FontSize="24" FontFamily="Segoe UI Light, Tahoma Light" />-->
                            <TextBlock IsHitTestVisible="False" Margin="20,0,0,0" Text="{Binding}" Foreground="#FFFFFFFF" FontSize="24" FontFamily="Segoe UI Light, Tahoma Light" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
View Code

 

转载于:https://www.cnblogs.com/czly/p/9394656.html

相关文章:

  • PowerDesigner使用小总结
  • 用开源技术巧解代账公司开票据难题
  • mysql 主从同步详细配置教程
  • cURL error 60: SSL certificate problem...
  • OSPF动态路由重分发实验
  • 数据库名称
  • 分库分表的面试题5
  • nginx配置.htaccess伪静态
  • pip更改国内源
  • android ndk cmake Invalid Android ABI
  • 基于命令序列的异常行为分析 业界研究现状分析
  • Python标准库(待续)
  • Python 爬虫获取网易云音乐歌手信息
  • WPF查找父元素子元素
  • 如何用vue打造一个移动端音乐播放器
  • 【刷算法】求1+2+3+...+n
  • CEF与代理
  • Consul Config 使用Git做版本控制的实现
  • es6(二):字符串的扩展
  • Java 内存分配及垃圾回收机制初探
  • Laravel核心解读--Facades
  • Netty 框架总结「ChannelHandler 及 EventLoop」
  • SegmentFault 技术周刊 Vol.27 - Git 学习宝典:程序员走江湖必备
  • UEditor初始化失败(实例已存在,但视图未渲染出来,单页化)
  • 得到一个数组中任意X个元素的所有组合 即C(n,m)
  • 关于Java中分层中遇到的一些问题
  • 前端_面试
  • 前端之React实战:创建跨平台的项目架构
  • 软件开发学习的5大技巧,你知道吗?
  • 异常机制详解
  • 不要一棍子打翻所有黑盒模型,其实可以让它们发挥作用 ...
  • 基于django的视频点播网站开发-step3-注册登录功能 ...
  • !!【OpenCV学习】计算两幅图像的重叠区域
  • #LLM入门|Prompt#1.8_聊天机器人_Chatbot
  • $.ajax中的eval及dataType
  • (2/2) 为了理解 UWP 的启动流程,我从零开始创建了一个 UWP 程序
  • (C++17) std算法之执行策略 execution
  • (C++20) consteval立即函数
  • (pojstep1.3.1)1017(构造法模拟)
  • (搬运以学习)flask 上下文的实现
  • (附程序)AD采集中的10种经典软件滤波程序优缺点分析
  • (力扣记录)235. 二叉搜索树的最近公共祖先
  • (论文阅读22/100)Learning a Deep Compact Image Representation for Visual Tracking
  • (免费领源码)python#django#mysql公交线路查询系统85021- 计算机毕业设计项目选题推荐
  • (七)Knockout 创建自定义绑定
  • (学习日记)2024.03.25:UCOSIII第二十二节:系统启动流程详解
  • (原創) 博客園正式支援VHDL語法著色功能 (SOC) (VHDL)
  • (转)真正的中国天气api接口xml,json(求加精) ...
  • (自适应手机端)响应式新闻博客知识类pbootcms网站模板 自媒体运营博客网站源码下载
  • .bat批处理(六):替换字符串中匹配的子串
  • .NET CF命令行调试器MDbg入门(三) 进程控制
  • .NET Core 控制台程序读 appsettings.json 、注依赖、配日志、设 IOptions
  • .Net下C#针对Excel开发控件汇总(ClosedXML,EPPlus,NPOI)
  • /etc/sudoer文件配置简析
  • []sim300 GPRS数据收发程序