Wpf - 如何更改UI的设计(元素的位置) [英] Wpf - how to change design (position of elements) of UI

查看:74
本文介绍了Wpf - 如何更改UI的设计(元素的位置)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi guys, please how could I change the position of the elements in the UI, or choose a different design when the application loads?

It could be done using User Controls for each design, but the bad thing about this solution is that the same code will be repeated and I do not want that.

Please what would be the best practices to achieve this, it should be noted that the controls must have a name to use it in the code.

Thanks in advance.

Summary: This is what I want to achieve

喜欢这些图片



我尝试过:



Like these pictures

What I have tried:

<Grid.ColumnDefinitions>
    <ColumnDefinition Width="{Binding LeftButtonColWidth}"/>
    <ColumnDefinition Width="{Binding RightMainPanelColWidth}"/>
</Grid.ColumnDefinitions>

I Wish: <Grid design ="{Load DesignN}" ...>

推荐答案

检查以下内容:

wpf - 如何显示不同对MainWindow的观点 - Stack Overflow [ ^ ]

使用MVVM在视图/用户控件之间切换Rachel Lim的博客 [ ^ ]

绑定WPF的不同方法查看和查看模型•全网点网络[ ^ ]
Check these:
wpf - How to display different views on MainWindow - Stack Overflow[^]
Switching between Views/UserControls using MVVM | Rachel Lim's Blog[^]
Different Ways to Bind WPF View And View Model • Dot Net For All[^]


这篇关于Wpf - 如何更改UI的设计(元素的位置)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆