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 应用程序.无论您是创 ...
随机推荐
- 五种开源协议(GPL,LGPL,BSD,MIT,Apache)
什么是许可协议? 什么是许可,当你为你的产品签发许可,你是在出让自己的权利,不过,你仍然拥有版权和专利(如果申请了的话),许可的目的是,向使用你产品的人提供 一定的权限. 不管产品是免费向公众分发,还 ...
- Python笔记(3)迭代器与生成器
参考自:http://www.cnblogs.com/huxi/category/251137.html 迭代器 迭代器是访问集合内元素的一种方式,他不能倒退只能一直迭代下去.可以写到for循环in后 ...
- BigDecimal 加减乘除
BigDecimal bignum1 = new BigDecimal("10"); BigDecimal bignum2 = new BigDecimal("5&quo ...
- Phylab2.0 文档汇总
实验数据处理脚脚本 编写规范 调用框架以及测试文件规范 脚本调用约定 API文档 用户部分后端请求说明 文章评论区部分后端请求说明 测试报告 测试报告集
- 时间戳 时区 java mysql
当一个时间 比如2016年5月6日,生成时间戳.这个运算是与时区有关的.首先得确认这个时间是哪个时区的,然后转换成utc时区的时间.再减去1970,得到的秒数,就是时间戳. 时间戳是个一定的值,他与时 ...
- BZOJ 4568 幸运数字
题目传送门 4568: [Scoi2016]幸运数字 Time Limit: 60 Sec Memory Limit: 256 MB Description A 国共有 n 座城市,这些城市由 n-1 ...
- less学习笔记
less is more , than css less使用到的编译工具: koala less使用的软件: sublime text(推荐使用) 在less 中注释使用的是// ( /**/ ...
- 《JavaScript DOM编程艺术(第二版)》读书总结
这本书是一本很基础的书,但对于刚入前端不久的我来说是一本不错的书,收获还是很大的,对一些基础的东西理解得更加透彻了. 1.DOM即document object model的缩写,文档对象模型,Jav ...
- Python学习笔记——条件和循环
1.条件表达式 >>> x = 3 >>> x = 1 if x<3 else 2 >>> x 2 2.for语句用于序列类型 <1& ...
- MyBatis源码分析(1)——整体依赖关系图
后续补充更新