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 应用程序.无论您是创 ...
随机推荐
- Ubuntu(基于Ubuntu)中常用的apt和dpkt命令
apt-get sudo apt-get install package 安装包 sudo apt-get -f install 修复安装”-f = ——fix-missing” sudo a ...
- JavaScript数组的方法
push() :将参数加载到数组的最后,返回数组的长度 pop() :删除数组的最后一个元素,返回删除的值 shift() :删除数组的第一个元素,返回删除的值 unshift ...
- python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?
python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...
- bzoj3033
欧拉路,这题好神啊QAQ 显然选择的方案数有2^n种,因为每个点度数都为二所以肯定是一条欧拉路, 第二问直接爆搜即可... ----然而我并没有想到---- 第一问我推出来了(别问我怎么推的,我说我是 ...
- mybatis一个怪异的问题: Invalid bound statement not found
ssm中报一下错误: invalid bound statement (not found): me.tspace.pm.dao.userdao.getuser at org.apache.ib ...
- C#之方法的声明与调用
//params关键字使用 class Program { static void Main(string[] args){ , , , }; Console.WriteLine(AddFunctio ...
- Google 地图 API V3 针对移动设备进行开发
Google官方教程: Google 地图 API V3 使用入门 Google 地图 API V3 针对移动设备进行开发 Google 地图 API V3 之事件 Google 地图 API V3 ...
- 最简单的STM32入门教程----闪烁LED
本文讲述的是如何从零开始,使用keil建立一个简单的STM32的工程,并闪烁LED灯,给小白看. 第零步,当然首先你得有一个STM32的板子,其IO口上接了一个LED... 第一步,建立一个文件夹0. ...
- UGUI
http://www.2fz1.com/post/unity-ugui-recttransform/ //this.transform.position 获取的是世界坐标,而 this.transfo ...
- druid 配置
连接池配置,以及相关配置 <bean id="logFilter" class="com.alibaba.druid.filter.logging.Slf4jLog ...