<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的更多相关文章

  1. Win10 UI入门RelativePanel(2)

    自适应 1) Gif: 添加动画 2)

  2. Win10 UI入门窗口由默认500px to 320px

    https://code.msdn.microsoft.com/Layout-for-windows-that-ba648e1c/ https://msdn.microsoft.com/library ...

  3. Win10 UI入门 SliderRectangle

    看了@段博琼大哥导航滑动的思路,自己又做了一个类似与黄油相机里面的一个功能 <Grid x:Name="> <Grid.ColumnDefinitions> < ...

  4. Win10 UI入门 圆形控件

    动态模版绑定 http://blog.csdn.net/XXChen2/article/details/4552554

  5. Win10 UI入门 RenderTransform属性分析之Translate 平移变形

    对齐方式是中心底部对齐: HorizontalAlignment="Center" VerticalAlignment="Bottom" 以底部边为起始线,向上 ...

  6. Win10 UI入门 pivot multiable DataTemplate

    this is a dynamic pivot with sliderable navigation and multiableDatatemplate Control 看了 alexis 大哥的pi ...

  7. Win10 UI入门 导航滑动条 求UWP工作

    借鉴了 段博琼 大哥写的导航滑动,自己实现了一个类似安卓 IOS 导航滑动条 支持等比例 分割 tabView 支持动画滑动 效果如下图 WYGrid 你可以想象一个GridView  itemsWr ...

  8. jQuery UI 入门之实用实例分享

    jQuery UI 入门 jQuery UI 简介 jQuery UI 是一个建立在 jQuery JavaScript 库上的小部件和交互库,您可以使用它创建高度交互的 Web 应用程序.无论您是创 ...

  9. jQuery UI 入门之实用实例

    jQuery UI 入门 jQuery UI 简介 jQuery UI 是一个建立在 jQuery JavaScript 库上的小部件和交互库,您可以使用它创建高度交互的 Web 应用程序.无论您是创 ...

随机推荐

  1. Android基础总结(二)

    常见布局 相对布局 RelativeLayout 组件默认左对齐.顶部对齐 设置组件在指定组件的右边 android:layout_toRightOf="@id/tv1" 设置在指 ...

  2. 神经网络和Deep Learning

    参考资料: 在线免费书籍 http://neuralnetworksanddeeplearning.com/chap1.html Chapter 1 1.  perceptron 感知机 it's a ...

  3. a版本冲刺第一天

    队名:Aruba   队员: 黄辉昌 李陈辉 林炳锋 鄢继仁 张秀锋 章  鼎 学号 昨天完成的任务 今天做的任务 明天要做的任务 困难点 体会 408 学习测试文档的编写 继续学习并借鉴,开始着手写 ...

  4. microsoft docx document operation with Java POI library

    microsoft docx document operation with Java POI library combine multiple docx document into one docu ...

  5. JSF primefaces session view expired 会话失效后页面跳转

    web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi=" ...

  6. Linux/Mac/Shell常用命令

    常用命令 · ls 查看当前目录下的文件 · cd 进入某目录 · cd - 跳转回前一目录 · cd ~ 进入当前用户个人目录 · pwd 输出当前所在路径 · mkdir 新建文件夹 · touc ...

  7. 10月25日下午PHP静态、抽象、接口

    多态(运行多态)概念:当父类引用指向子类实例,由于子类里面对父类的方法进行了重写,父类引用在调用该方法的时候表现出的不同状态.条件:1.必须发生在继承下2.必须重写父类方法3.父类引用调用该方法 如果 ...

  8. centos 7.1 apache 源码编译安装

    Apache编译安装 一,需要软件: http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gz 1.apr-1.5.2.tar.gz http://mi ...

  9. 四、Shell输入、输出功能和字符颜色设置

    一.Shell输入功能 1.键盘输入   方式一: [root@Salve four]# cat test.sh #!/bin/bash #-e 参数可以解析语句中的转义字符 echo -e &quo ...

  10. zabbix添加监控主机(三)

    zabbix添加监控服务器. zabbix添加监控服务器(以添加10.10.100.137为例) (1)创建要监控的主机.点击配置(configuration)–>主机(host) –>创 ...