Win10 UI入门RelativePanel

<RelativePanel Background="Black" >
<Rectangle x:Name="midRe" Fill="Red" Width="" Height=""
RelativePanel.AlignHorizontalCenterWithPanel="True"
RelativePanel.AlignVerticalCenterWithPanel="True"/> <Rectangle x:Name="topLeftRe" Fill="Green" Width="" Height=""
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignTopWithPanel="True"/> <Rectangle x:Name="topRightRe" Fill="Yellow" Width="" Height=""
RelativePanel.AlignRightWithPanel="True"
RelativePanel.AlignTopWithPanel="True"/> <Rectangle Fill="Yellow" Width="" Height="" RelativePanel.Above="midRe" RelativePanel.AlignLeftWith="midRe"/>
<Rectangle Fill="Yellow" Width="" Height="" RelativePanel.AlignTopWith="midRe" RelativePanel.LeftOf="midRe"/>
<Rectangle Fill="Yellow" Width="" Height="" RelativePanel.AlignTopWith="midRe" RelativePanel.RightOf="midRe"/>
<Rectangle Fill="Yellow" Width="" Height="" RelativePanel.Below="midRe" RelativePanel.AlignLeftWith="midRe"/>
<Rectangle Fill="Yellow" Width="50" Height="50" RelativePanel.AlignHorizontalCenterWithPanel="True"
RelativePanel.AlignVerticalCenterWithPanel="True" RelativePanel.RightOf="midRe"
/>
<Rectangle x:Name="bottomLeftRe" Fill="Gray" Width="" Height=""
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignBottomWithPanel="True"/> <Rectangle x:Name="bottomRightRe" Fill="Blue" Width="" Height=""
RelativePanel.AlignRightWithPanel="True"
RelativePanel.AlignBottomWithPanel="True"/>
</RelativePanel>
后代代码
http://blog.falafel.com/windows-10-development-relativepanel/
http://stackoverflow.com/questions/31852833/relative-width-for-ui-elements-with-relativepanel-in-xaml-with-uwp-apps
并且可以删除子项
/// <summary>
/// ScrollViewer scrollViewer = FindChildOfType<ScrollViewer>(listbox1);
/// </summary>
public T FindChildOfType<T>(DependencyObject root) where T : class
{
var queue = new Queue<DependencyObject>();
queue.Enqueue(root);
while (queue.Count > )
{
DependencyObject current = queue.Dequeue();
for (int i = VisualTreeHelper.GetChildrenCount(current) - ; <= i; i--)
{
var child = VisualTreeHelper.GetChild(current, i);
var typedChild = child as T;
if (typedChild != null)
{
return typedChild;
}
queue.Enqueue(child);
}
}
return null;
}
public T FindParentOfType<T>(DependencyObject obj) where T : FrameworkElement
{
DependencyObject parent = VisualTreeHelper.GetParent(obj);
while (parent != null)
{
if (parent is T)
{
return (T)parent;
}
parent = VisualTreeHelper.GetParent(parent);
}
return null;
}
工具

Win10 UI入门RelativePanel的更多相关文章
- Win10 UI入门RelativePanel(2)
自适应 1) Gif: 添加动画 2)
- Win10 UI入门窗口由默认500px to 320px
https://code.msdn.microsoft.com/Layout-for-windows-that-ba648e1c/ https://msdn.microsoft.com/library ...
- Win10 UI入门 SliderRectangle
看了@段博琼大哥导航滑动的思路,自己又做了一个类似与黄油相机里面的一个功能 <Grid x:Name="> <Grid.ColumnDefinitions> < ...
- Win10 UI入门 圆形控件
动态模版绑定 http://blog.csdn.net/XXChen2/article/details/4552554
- Win10 UI入门 RenderTransform属性分析之Translate 平移变形
对齐方式是中心底部对齐: HorizontalAlignment="Center" VerticalAlignment="Bottom" 以底部边为起始线,向上 ...
- Win10 UI入门 pivot multiable DataTemplate
this is a dynamic pivot with sliderable navigation and multiableDatatemplate Control 看了 alexis 大哥的pi ...
- Win10 UI入门 导航滑动条 求UWP工作
借鉴了 段博琼 大哥写的导航滑动,自己实现了一个类似安卓 IOS 导航滑动条 支持等比例 分割 tabView 支持动画滑动 效果如下图 WYGrid 你可以想象一个GridView itemsWr ...
- jQuery UI 入门之实用实例分享
jQuery UI 入门 jQuery UI 简介 jQuery UI 是一个建立在 jQuery JavaScript 库上的小部件和交互库,您可以使用它创建高度交互的 Web 应用程序.无论您是创 ...
- jQuery UI 入门之实用实例
jQuery UI 入门 jQuery UI 简介 jQuery UI 是一个建立在 jQuery JavaScript 库上的小部件和交互库,您可以使用它创建高度交互的 Web 应用程序.无论您是创 ...
随机推荐
- 私有项目免费使用Git
GitHub,私有项目是要收费了,如果想建立私有项目可以选择GitLab. GitLab注册地址:https://gitlab.com/users/sign_in 本机需要安装git,图形化的工具使用 ...
- [转]<jsp:include>和<%@include%>的区别
首先,转发自yangbobo1992的 <jsp:include>和<%@include%>的区别 这个是我见过写的最好的之一 <%@include%>和<j ...
- Akka框架使用注意点
1.mailbox Akka的每个actor默认有一个mailbox,按照FIFO顺序单线程处理.在抛出异常导致父actor根据设置的监管策略执行重启或恢复操作时,会从触发异常的消息的后续消息开始处理 ...
- Agent理解
简单来说,Agent是一个交互性的技术. 比如我们在网上购物时,主体是人,即请求的发出者,我们在搜索商品时,向系统发出请求,系统会给我们一个返回结果,然而我们发现很多情况下,我们会在商品栏目中发现我们 ...
- 新手理解HTML、CSS、javascript之间的关系
http://www.cnblogs.com/dreamingbaobei/p/5062901.html 工作多年,一直忙忙碌碌的应用各种技术,现在不忙了,问问自己究竟在做什么,究竟会什么竟答不上来, ...
- 搭建FTP服务器
yum install vsftpd -yyum install pam* db4* --skip-broken –y 创建并生成vsftpd 数据库文件vi /etc/vsftpd/ftpusers ...
- c# winform 动态画矩形 矩形大小可以拖动
http://jhlong12345.blog.163.com/blog/static/1230631292015544450189/# 结合上一篇,继续 矩形大小的调整 还有小bug,思路有了 ...
- Google Map API V3开发(5)
Google Map API V3开发(1) Google Map API V3开发(2) Google Map API V3开发(3) Google Map API V3开发(4) Google M ...
- asp rs开启关闭问题
使用rs.close关闭后,可以直接用rs.open来打开数据表:如果用了set rs = nothing 从内存中清除rs对象,再次加载rs对象就需要使用set rs=server.createob ...
- PHP 表单
PHP 中的 $_GET 和 $_POST 变量用于检索表单中的信息,比如用户输入. 表单验证: 应该在任何可能的时候对用户输入进行验证(通过客户端脚本).浏览器验证速度更快,并且可以减轻服务器的负载 ...