0

I'd like to add the imagebutton control to my windows store app, however when I install the Winrt Xaml Toolkit using NuGet it does not allow me (using the intellisense) to add any new controls. All I'd like to do is be able to specify an image for an appBarButton when hovered and an image when pressed. I find it slightly ridiculous that Microsoft has made it so difficult. Any help is MUCH appreciated.

4

1 回答 1

0

有趣的是,我如何在编程上花费数小时却没有成功,然后第二天早上在 5 分钟内找到答案。这是我需要的答案,在

在 Windows 8 的 XAML 中悬停或单击时如何更改按钮的背景图像?

我需要在页面顶部添加这个 xml 命名空间... xmlns:controls="using:WinRTXamlToolkit.Controls"

然后这行得通。

    <controls:ImageButton HorizonalAlignment="Center"
        NormalStateImageSource="normal.png"
        HoverStateImageSource="hover.png"
        PressedStateImageSource="pressed.png" />

希望这可以帮助其他有同样问题的人。

于 2014-06-28T15:39:06.573 回答