是否有可能在XAML中做类似于ffloat的东西:左边用于CSS中的图像.我需要创建这样的东西:

具有可变图像尺寸和文本长度.
编辑:在我的情况下,图像周围的文本扭曲不是静态的,它是在C#代码中创建的,它返回一个TextBlock元素列表(带有运行)
在我的Windows 8 Metro风格应用程序中,我将Listview绑定到ObservableCollection,我希望每个ListViewItem的背景颜色交替(白色,灰色,白色等)
<ListView x:Name="stopsListView" ItemsSource="{Binding}" >
<ListView.ItemTemplate>
<DataTemplate>
<Grid Height="66" >
<TextBlock Text="{Binding Title}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
Run Code Online (Sandbox Code Playgroud)
在WPF中,这是使用带触发器的样式完成的 - 请参阅此页面.
你如何在Metro应用程序中实现这一目标?
更新:
在下面给出了正确答案之后,我离开并实际编码了它.以下是需要它的人的一些代码:
值转换器类代码:
public class AltBackgroundConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
if (!(value is int)) return null;
int index = (int)value;
if (index % 2 == 0)
return Colors.White;
else
return Colors.LightGray;
}
// No need to implement converting back on a one-way binding
public object …Run Code Online (Sandbox Code Playgroud) 所以我有一个泄露内存的.NET Windows应用商店应用.我能做些什么呢?我用于jetBrains或Red-Gate/ANTS的桌面应用程序的探查器工具不支持Metro应用程序(或者他们现在做什么?)
我正在寻找一种方法来检查Windows 8商店应用程序中运行的XAML.基本上,我想要firebug/chrome检查器样式功能,我可以查看运行时生成的XAML源,以调试简单的布局和样式问题.
我尝试过Snoop,Pistachio和WPF Inspector,但没有适用于Windows应用商店应用.我能找到的唯一一个似乎适用于商店应用程序的是XAML Spy,这是90欧元.我无法证明这笔费用是合理的.
有没有其他方法来检查运行XAML?
xaml windows-8 windows-runtime winrt-xaml windows-store-apps
有人可以解释的意义操纵模式,例如TranslateX,TranslateRailsX,TranslateInertia?什么是rail mode?他们在说什么惯性?
Silverlight单元测试框架具有[Asynchronous]属性(AsynchronousAttribute),该属性使测试仅在EnqueueTestComplete()被调用时结束.这允许一种简单的方法来编写需要在事件结束之前等待事件发生的测试.现在我试图从那些似乎是最受欢迎的选择中选择一个最喜欢的通用单元测试框架 - VSUTF,NUnit,xUnit.NET,MbUnit和我想知道 - 你将如何使用这些框架进行异步测试?
我想我可以推出一些自定义代码来执行Monitor.Wait或ResetEventWaitOne并在测试方法结束时调用它,然后在测试结束时执行Pulse/Set,但我在查看是否存在通用/内置解决方案.
这是一个如何在SUT中完成的示例(来自http://smartypantscoding.com/a-cheat-sheet-for-unit-testing-silverlight-apps-on-windows-phone-7).
[TestClass]
public class AsyncTests : SilverlightTest
{
[Asynchronous]
[TestMethod]
public void AsyncAppendStringTest()
{
var appendStrings = new List<string>() { "hello", "there" };
StringJoiner.AsyncAppendStringsWithDashes(appendStrings, (returnString) =>
{
Assert.IsTrue(string.Compare(returnString, "hello-there") == 0);
EnqueueTestComplete();
});
}
}
Run Code Online (Sandbox Code Playgroud) 是否可以删除gridview中项目的点按效果?
在为Win 8 Metro控件编写自定义ControlTemplate(XAML)时,我们需要使用VisualStateManager根据VisualState转换更新控件.我在MSDN上看到了下面的示例,但是我找不到VisualStateGroup"CommonStates"的记录位置以及除"PointerOver"和"Normal"之外定义的其他VisualStates?您是否需要深入了解SDK以找到按钮的默认ControlTemplate?如果是的话,在哪里?
<ControlTemplate TargetType="Button">
<Grid >
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<!--Take one half second to transition to the PointerOver state.-->
<VisualTransition To="PointerOver"
GeneratedDuration="0:0:0.5"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<!--Change the SolidColorBrush, ButtonBrush, to red when the
Pointer is over the button.-->
<VisualState x:Name="PointerOver">
<Storyboard>
<ColorAnimation Storyboard.TargetName="ButtonBrush"
Storyboard.TargetProperty="Color" To="Red" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.Background>
<SolidColorBrush x:Name="ButtonBrush" Color="Green"/>
</Grid.Background>
</Grid>
</ControlTemplate>
Run Code Online (Sandbox Code Playgroud) 为了开发目的,如何在模拟器中运行Windows RT(Windows 8的受限ARM版本)?这个问题包含两部分:
我需要在Visual Studio 2015中添加新配置.存在其他配置并且正确且有效.
当我有一个名为"Test"的新配置时,在选项"Copy Settings from:"中选择"Empty"并选中"Create new project configuration".
如果我使用这个新配置运行应用程序(例如Release,Debug等...)我有一个错误:
"无法在锁定文件中找到所需信息.请确保您的目标中提到了UAP,版本= v10.0.240/Win10-".
我不知道解决这个错误.
谁来帮帮我?
谢谢
configuration win-universal-app windows-10 visual-studio-2015