WPF界面UI設計開發心得


(1)美工和后台可以完全分開了,前端使用blend微軟專用設計器設計,后端老牌vs.

 (2) 完全可以安照設計web界面方式設計。

(3)winform時代也能實現不過需要通過操作panel來布局。

直接上界面圖:

//---------------------------------------------------------------------

 

<Window xmlns:fx="clr-namespace:FxSplitContainer;assembly=FxSplitContainer" 
        xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"  x:Class="IccKinectSnow.MainFrm"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="1024">
 <Border BorderBrush="#FF02CBFF" Background="#FF01354C" BorderThickness="1">
        <DockPanel x:Name="LayoutRoot" LastChildFill="true">
            <StackPanel x:Name="pnlTitle" DockPanel.Dock="Top" Height="21">
    <StackPanel.Background>
                    <ImageBrush ImageSource="style\border_top_bg.jpg" Stretch="Fill"/>
    </StackPanel.Background>
    <DockPanel>
                    <Image Source="style\mlogo.png" Height="16" Width="16"/>
                    <Label x:Name="lblTitle" Content="體感游戲商務一體化平台" DockPanel.Dock="Left" Foreground="White"/>
     <WrapPanel HorizontalAlignment="Right">
                        <Image x:Name="btnMin"  VerticalAlignment="Top" Margin="0,0,3,0"/>
                        <Image x:Name="btnMax" VerticalAlignment="Top"  Margin="0,0,3,0"/>
                        <Image x:Name="btnClose" VerticalAlignment="Top"  Margin="0,0,3,0"/>
     </WrapPanel>
    </DockPanel>
   </StackPanel>
      <StackPanel DockPanel.Dock="Top">
                <DockPanel>
                    <Image Height="105" Source="style\logo.jpg" />
                    <WrapPanel HorizontalAlignment="Right">
                        <TextBlock x:Name="txtSrc" Foreground="Yellow"></TextBlock>
                        <TextBlock x:Name="txtMsg" Foreground="Yellow"></TextBlock>
                    </WrapPanel>
                    <Button Content="測試" Height="23" Name="button1" Width="75" Visibility="Hidden" />
                </DockPanel>
            </StackPanel>
   <StackPanel DockPanel.Dock="Top" Height="33">
    <StackPanel.Background>
                    <ImageBrush ImageSource="style\bar_bg.png" Stretch="Fill"/>
    </StackPanel.Background>
   </StackPanel>
            <StackPanel DockPanel.Dock="Bottom" Height="33">
    <StackPanel.Background>
                    <ImageBrush ImageSource="style\border_bottom_bg.png" Stretch="Fill"/>
    </StackPanel.Background>
                <DockPanel>
                    <Label x:Name="lblVersion" DockPanel.Dock="Left" Margin="0,3,0,0"/>
                    <WrapPanel HorizontalAlignment="Right">
                        <Label x:Name="lblCopyright" DockPanel.Dock="Left" Margin="0,3,0,0"/>
                        <ResizeGrip Height="33"/>
                    </WrapPanel>
                </DockPanel>
   </StackPanel>
          <StackPanel x:Name="pnlContent">
                <StackPanel DockPanel.Dock="Top">
                      <DockPanel>
                        <!--Margin:left,top,right,bottom-->
                        <StackPanel Width="250" Height="33" DockPanel.Dock="Right" Margin="3,3,3,0">
                            <StackPanel.Background>
                                <ImageBrush ImageSource="style\content_bar_bg.jpg" Stretch="Fill"/>
                            </StackPanel.Background>
                            <WrapPanel>
                                <Image Width="13" Height="24" Source="style\arrow.png"/>
                                <Label x:Name="lblKinectSet" Height="33" Content="雲台配置" Margin="0,5,0,0" Foreground="#FF074576"/>
                            </WrapPanel>
                        </StackPanel>
                        <StackPanel Height="33" Margin="3,3,3,0">
                            <StackPanel.Background>
                                <ImageBrush ImageSource="style\content_bar_bg.jpg" Stretch="Fill"/>
                            </StackPanel.Background>
                            <WrapPanel>
                                <Image Width="13" Height="24" Source="style\arrow.png"/>
                                <Label x:Name="lblKinectList" Height="33" Content="雲台列表" Margin="0,5,0,0" Foreground="#FF074576"/>
                            </WrapPanel>
                        </StackPanel>
                    </DockPanel>
                </StackPanel>
                <StackPanel DockPanel.Dock="Top">
                   <DockPanel>
                        <StackPanel DockPanel.Dock="Right" Width="250" Background="#e7f6fe"  Margin="3,0,3,0">
                     
                        </StackPanel>
                        <StackPanel Background="#e7f6fe" Margin="3,0,3,0">
                            <Viewbox Stretch="Fill">
                                <WrapPanel Orientation="Horizontal">
                                    <Grid Margin="5"  ClipToBounds="True">
                                        <Image x:Name="imageColor" Width="320" Height="240"/>
                                        <Canvas x:Name="canvasColor"></Canvas>
                                    </Grid>
                                    <Grid Margin="5"  ClipToBounds="True">
                                        <Image x:Name="imageDepth" Width="320" Height="240"/>
                                        <Canvas x:Name="canvasDepth"></Canvas>
                                    </Grid>
                                </WrapPanel>
                            </Viewbox>
                        </StackPanel>
                    </DockPanel>
                </StackPanel>
            </StackPanel>
  </DockPanel>
 </Border>
</Window>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM