Wpf 如何设置listview内部图像的宽度或高度,并跟随4英寸屏幕?
我只想将设备上图像的高度宽度设置为4英寸。 如何设置?我开发通用应用程序 注意:这是4英寸。Wpf 如何设置listview内部图像的宽度或高度,并跟随4英寸屏幕?,wpf,win-universal-app,Wpf,Win Universal App,我只想将设备上图像的高度宽度设置为4英寸。 如何设置?我开发通用应用程序 注意:这是4英寸。 <grid layoutUpdated="Grid_LayoutUpdated"> <listview> <listview.itemsTemplate> <datatemplate> <grid> <imag
<grid layoutUpdated="Grid_LayoutUpdated">
<listview>
<listview.itemsTemplate>
<datatemplate>
<grid>
<image source="a.png" width=100 height=100>
...........
private void Gird_LayoutUpdated(.....)
{
what do I write?....
}
public static DependencyObject MyFindListBoxChildByName(DependencyObject parant, string ControlName)
{
int count = VisualTreeHelper.GetChildrenCount(parant);
for (int i = 0; i < count; i++)
{
var MyChild = VisualTreeHelper.GetChild(parant, i);
if (MyChild is FrameworkElement && ((FrameworkElement)MyChild).Name == ControlName)
return MyChild;
var FindResult = MyFindListBoxChildByName(MyChild, ControlName);
if (FindResult != null)
return FindResult;
}
return null;
}
...........
私有无效网格布局已更新(…)
{
我写什么?。。。。
}
公共静态DependencyObject MyFindListBoxChildByName(DependencyObject parant,string ControlName)
{
int count=VisualTreeHelper.GetChildrenCount(parant);
for(int i=0;i