小编Fil*_*kun的帖子

如何在XAML中"浮动"图像(Windows 8 Metro)

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

在此输入图像描述

具有可变图像尺寸和文本长度.

编辑:在我的情况下,图像周围的文本扭曲不是静态的,它是在C#代码中创建的,它返回一个TextBlock元素列表(带有运行)

c# xaml windows-8 windows-runtime winrt-xaml

8
推荐指数
1
解决办法
4791
查看次数

Metro应用程序 - ListView - 如何替换ListViewItems的背景颜色

在我的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 xaml windows-runtime winrt-xaml windows-store-apps

8
推荐指数
1
解决办法
5523
查看次数

如何调试Windows应用商店应用中的内存泄漏?

所以我有一个泄露内存的.NET Windows应用商店应用.我能做些什么呢?我用于jetBrains或Red-Gate/ANTS的桌面应用程序的探查器工具不支持Metro应用程序(或者他们现在做什么?)

.net profiling windows-8 windows-runtime windows-store

8
推荐指数
1
解决办法
3520
查看次数

在Windows 8 Store Apps/VS2012中检查XAML

我正在寻找一种方法来检查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

8
推荐指数
2
解决办法
3796
查看次数

ManipulationMode解释道

有人可以解释的意义操纵模式,例如TranslateX,TranslateRailsX,TranslateInertia?什么是rail mode?他们在说什么惯性?

windows-8 windows-runtime winrt-xaml uwp uwp-xaml

8
推荐指数
1
解决办法
2238
查看次数

VSUTF,NUnit,xUnit.NET,MbUnit与SUTF中的异步测试?

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)

c# mbunit nunit mstest xunit.net

7
推荐指数
1
解决办法
625
查看次数

7
推荐指数
3
解决办法
1万
查看次数

哪些可能的VisualStates for Windows 8 Metro控件记录在哪里?

在为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)

xaml windows-8 windows-runtime winrt-xaml

7
推荐指数
1
解决办法
3737
查看次数

如何模拟Windows RT

为了开发目的,如何在模拟器中运行Windows RT(Windows 8的受限ARM版本)?这个问题包含两部分:

  • 获取映像:是否存在安装映像(对于供应商,在MSDN中,...)?我可以拍摄Surface RT磁盘的快照(如何?),或者我可以从恢复数据中以某种方式提取它(我不知道恢复系统是如何工作的,但是有一个功能可以在Surface上完全擦除并重新安装软件).
  • 运行图像:我可以模仿它吗?我听说过QEMU,但它的声誉很慢.此外,程序必须模拟必要的硬件(Tegra-3).

arm emulation windows-8 windows-rt

7
推荐指数
2
解决办法
4894
查看次数

配置Visual Studio 2015 - Windows 10项目

我需要在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

7
推荐指数
1
解决办法
659
查看次数