标签: windows-runtime

即使从HTML/JS或XAML创建控件,Metro控件是否在低级别重用相同的代码路径?

假设我创建了两个metro应用程序,

一个有HTML视图的

<input type="text"/>
Run Code Online (Sandbox Code Playgroud)

另一个基于XAML的视图

<TextBox/>
Run Code Online (Sandbox Code Playgroud)

底层实现是否映射到相同的代码以呈现两个控件?他们会有100%完全相同的行为吗?

html xaml controls windows-8 windows-runtime

12
推荐指数
1
解决办法
427
查看次数

WinRT中的HttpUtility.HtmlDecode

HttpUtility.HtmlDecode在WinRT中是否有相同的功能?我正在开发一个MetroStyle应用程序,并希望解码来自XML文档的字符串.

xml windows-runtime

12
推荐指数
2
解决办法
4607
查看次数

Windows 8主题颜色 - 以编程方式访问它

在Windows 8消费者预览中,您可以个性化您的体验,包括设置"背景颜色",然后将其用作选定图块,应用栏等的背景.因此,选择橙色将意味着在Windows 8 Metro UI中可以看到橙色重音.

我目前正在创作一些自定义控件,我想在我的样式中访问这种颜色,因此当用户更改颜色时,我的应用程序重音会相应地重新着色.

在XAML中找不到这种颜色的方法.期望您可以引用系统级动态画笔或颜色资源似乎是合理的.

有没有人有任何想法?

xaml windows-8 windows-runtime winrt-xaml windows-store-apps

12
推荐指数
2
解决办法
6564
查看次数

如何在Metro GridView中创建组使用不同的布局?

我正在写一个Windows 8 Metro应用程序.我正在尝试使用三个组绘制GridView.我希望其中一个组以不同于其他组的方式布置项目.我之前在WPF中使用过选择器,所以我认为这是一条好路线.所以我尝试了GroupStyleSelector,我在MSDN上找到了这个例子:

public class ListGroupStyleSelector : GroupStyleSelector
{
  protected override GroupStyle SelectGroupStyleCore(object group, uint level)
  {
    return (GroupStyle)App.Current.Resources["listViewGroupStyle"];
  }
}
Run Code Online (Sandbox Code Playgroud)

所以我改编/扩展了适合我的东西:

CS:

public class ExampleListGroupStyleSelector : GroupStyleSelector
{
  public ExampleListGroupStyleSelector ()
  {
     OneBigItemGroupStyle = null;
     NormalGroupStyle = null;
  }

  public GroupStyle OneBigItemGroupStyle { get; set; }
  public GroupStyle NormalGroupStyle { get; set; }

  protected override GroupStyle SelectGroupStyleCore( object group, uint level )
  {
     // a method that tries to grab an enum off the bound …
Run Code Online (Sandbox Code Playgroud)

c# microsoft-metro windows-runtime

12
推荐指数
1
解决办法
3320
查看次数

检查WinRT中的项目中是否存在文件

我有一个WinRT Metro项目,它根据所选项目显示图像.但是,某些选定的图像将不存在.我想要做的是陷入不存在的情况并显示替代方案.

到目前为止,这是我的代码:

internal string GetMyImage(string imageDescription)
{
    string myImage = string.Format("Assets/MyImages/{0}.jpg", imageDescription.Replace(" ", ""));

    // Need to check here if the above asset actually exists

    return myImage;
}
Run Code Online (Sandbox Code Playgroud)

示例调用:

GetMyImage("First Picture");
GetMyImage("Second Picture");
Run Code Online (Sandbox Code Playgroud)

所以Assets/MyImages/SecondPicture.jpg存在,但Assets/MyImages/FirstPicture.jpg没有.

起初我想过使用WinRT相当于File.Exists(),但似乎没有.无需尝试打开文件并捕获错误,我可以简单地检查文件是否存在,或者文件是否存在于项目中?

windows-8 windows-runtime windows-store-apps

12
推荐指数
2
解决办法
1万
查看次数

如何从WinRT/Windows应用商店应用程序发送电子邮件?

我正在开发Windows应用商店应用程序(Windows 8).

我需要根据存储在应用程序数据中的数据和地址发送电子邮件,而无需用户输入数据或地址.

实现它的正确/简单方法是什么?

EitanB

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

12
推荐指数
3
解决办法
2万
查看次数

在Windows应用商店应用中实现下划线超链接的最佳方式?

从我所看到的,似乎没有功能来实现Windows RT中TextBlocks或HyperlinkButtons等的下划线,这看起来很荒谬,但无论如何,是否有人有一个优雅的方法来解决这个问题,特别是创建一个链接,运行Click事件或绑定命令?

您可以看到开箱即用的支持似乎不存在:http://social.msdn.microsoft.com/Forums/en-CA/winappswithcsharp/thread/cba0c363-60da-4e

windows-runtime winrt-xaml windows-store-apps

12
推荐指数
2
解决办法
5956
查看次数

使用C#在Windows 8上获取当前线程ID

已从WinRT中删除System.Threading.Thread(带.CurrentThread.ThreadId等).是否有可能在Windows 8中获取当前线程ID(用于调试和记录?)?

c# multithreading windows-runtime windows-store-apps

12
推荐指数
1
解决办法
5638
查看次数

在WinRT中使用FlipView和DataTemplateSelector动态显示项目

我正在使用Flipview和DataTemplateSelector在运行时确定要应用于我的控件中显示项目的DataTemplate.

我有两个DataTemplate,一个是静态的,第二个可以由未确定数量的项使用.

目前

我的第一个视图显示: - "这是一个测试 - 内容"

Followed by 18 other views看起来像这样: - " http://www.google.com/ 0" - " http://www.google.com/ 1" - " http://www.google.com/ 2" - 等等直到17日

我想要

要将" http://www.google.com/ " 项目分组为3 on a view.

例如,第二个视图将显示:

第三个视图将显示:

等等..

贝娄是我的代码:

FlipViewDemo.xaml

<Page.Resources>
    <DataTemplate x:Key="FirstDataTemplate">
        <Grid>
            <TextBlock Text="{Binding Content}" Margin="10,0,18,18"></TextBlock>
        </Grid>
    </DataTemplate>
    <DataTemplate x:Key="SecondDataTemplate">
        <TextBox Text="{Binding Url}"></TextBox>
    </DataTemplate>
    <local:MyDataTemplateSelector x:Key="MyDataTemplateSelector"
                FirstTextTemplate="{StaticResource FirstDataTemplate}"
                SecondTextTemplate="{StaticResource SecondDataTemplate}">
    </local:MyDataTemplateSelector> …
Run Code Online (Sandbox Code Playgroud)

.net c# wpf xaml windows-runtime

12
推荐指数
1
解决办法
1686
查看次数

无法在SQLite Net Platform WinRT中加载DLL'sqlite3'

我正在使用Xamarin.Forms开发本机应用程序.但我现在面临的问题与Xamarin无关.我添加了新的Windows Phone项目

right-click > Add > New Project -> Windows Phone Apps -> Blank App(Windows Phone).

在我在Visual Studio premium 2013中的现有Xamarin项目中.我使用sqlitenet pcl进行数据库连接.我的项目中有以下代码.

public ISQLitePlatform CreateSqlitePlatformInterface()
        {
            return new SQLitePlatformWinRT();
        }
Run Code Online (Sandbox Code Playgroud)

当它在行上面执行时,它会抛出异常

An exception of type 'System.DllNotFoundException' occurred in SQLite.Net.Platform.WinRT.DLL but was not handled in user code

Additional information: Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Run Code Online (Sandbox Code Playgroud)

这已被问了很多次,我尝试了所有建议的解决方案,但我仍然无法解决它.

我的Packages.config

 <package id="SQLite.Net-PCL" version="3.0.5" targetFramework="wpa81" />
  <package id="Sqlite-Winrt" version="3.8.7.1" targetFramework="wpa81" />
  <package id="Xamarin.Forms" version="1.4.2.6359" targetFramework="wpa81" /> …
Run Code Online (Sandbox Code Playgroud)

c# sqlite windows-runtime

12
推荐指数
2
解决办法
7552
查看次数