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 应用程序.无论您是创 ...
随机推荐
- 放下恩怨,曝小米中兴投关键性一票让华为顺利取得5G短码控制权
如果说最近国内科技公司最牛逼最令人振奋的新闻是啥,显然,就是两天前在3GPP RAN1 87次会议的5G短码方案讨论中,华为顺利碾压高通,战胜列强,拿下了5G的控制编码方案的标准. 虽然说,目前,华为 ...
- 服务器IIS同时支持ASP和PHP
有一台在用的服务器,系统环境是windows2008R2,上面运行了个app后台程序,现在需要放点PHP代码,需要和java同时使用. 实现方法: 1.安装phpmanger for iis,按照教程 ...
- Beta阶段第二次Scrum Meeting
此文章已于 2:51:42 2016/12/8 重新发布到 buaa_overwatch Beta阶段第二次Scrum Meeting 情况简述 BETA阶段第二次Scrum Meeting 敏捷开发 ...
- animate对颜色设置不起作用
今天了解了一下stop的使用方法,但是实例中加入color:red的时候,动画效果没有实现,具体实例如下: http://jsbin.com/fezaroyene/edit?html,js,outpu ...
- Linux ip
工具/原料 linux系统 putty 方法/步骤 Linux下查看IP一般都是用命令在终端查看了,使用命令行来进行查看. 想要在图形界面查看的朋友也有办法,不过就比较复杂,不如一条命令来得痛 ...
- C# 访问数据库
1. 首先引用和生命system.data.sqlClient 2. 使用sqlconnect类链接,sqlcommand类执行SQL命令,最后结果返回给sqlDataReader类或者是其他类 3. ...
- java高级特性
第二章 XML(可扩展标记语言) XML格式能够表达层次结构,并且重复的元素不会被曲解. 与HTML不同,XML是大小写敏感的. 必须有结束符. 属性值必须用引号括起来. 所有属性必须都有属性值. X ...
- Fragment应用总结
1.FrameLayout 常用于作为Android自带组件的父节点 2.Fragment就是一个普通的Java类,用Android.app这个包 Fragment也是一个ListVi ...
- codevs2572 路面修整
题目描述 Description Mr. Ling打算好好修一下学校门口的那条凹凸不平的路.按照Mr. Ling的设想,修好后的路面高度应当单调上升或单调下降,也就是说,高度上升与高度下降的路段不能同 ...
- PHP同时上传“多个”文件示例,并格式化$_FILES数组信息
方法1: 在html表单,放置多个文件选择框, 使用数组名作为组件的名字,如下: <form action="upload.php" method="post&qu ...