标签: windows-runtime

有没有办法编写一个可以在Windows 7和Vista上运行的WinRt(Metro)应用程序?

我们不能让我们的客户长时间无法在落叶松中升级到Windows 8.但是,我们的应用需要 "平板电脑"/"触摸"版本.

那么我们如何才能支持Windows 8上的Metro与单个代码库中的当前客户的联系呢?

当WPF出现之后,经过很多微软推出的"推动"并使其在Windows XP上运行之后 - 就像WinRT所讨论的那样.

(我不希望任何解决方案在XP上工作,因为XP支持正在减少.)

另请参阅:ARM版本的Windows 8只能运行Metro(WinRt)风格的应用程序吗?

windows-7 microsoft-metro windows-8 windows-runtime

24
推荐指数
1
解决办法
5226
查看次数

auto foo = ref new Foo(); 什么是"参考"?

我正在观看来自// build /的视频,并且有几位MS开发人员在他们的C++ 11程序中使用了这样的语法:

auto foo = ref new Foo();
Run Code Online (Sandbox Code Playgroud)

我理解除了"ref"之外,这一行中所做的一切.那是什么意思?

c++ windows-runtime c++-cx

23
推荐指数
2
解决办法
5952
查看次数

Windows 8开发人员预览中缺少Type.GetProperty()方法

我正在尝试将一个简单的应用程序移植到Windows 8 Metro(WinRT).似乎缺少一些非常基本的方法.一个基本的例子:Type.GetProperty().它适用于Windows Phone 7,Silverlight和.NET客户端配置文件.我是否必须安装某些东西(例如,一个特殊的库),或者这种方法在.NET metro配置文件中根本不可用?

UPDATE

好的谢谢.现在我用this.GetType().GetTypeInfo().DeclaredProperties.

using System.Reflection;需要有这种GetTypeInfo()扩展方法.

c# reflection microsoft-metro windows-8 windows-runtime

23
推荐指数
2
解决办法
6621
查看次数

在WinRT中选择XAML的ListView和GridView

XAML中的GridView和ListView似乎是相同的控件.

开发人员如何在两者之间做出选择?

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

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

如何在面向Windows应用商店应用和WP7,WP8,WPF的便携式类库中处理图像?

我正在开发第一个针对以下目标的PCL:WSA(Windows应用商店应用),WPF,WP7,WP8.我们可以说它是一种rolerdex类型的应用程序,你有联系人,他们有联系方式和图像.(它不是,但我无法提供有关应用程序的详细信息,因此我使用的是一个非常简单的示例).以下是我的一些问题:)

  1. 我应该在PCL中有图像吗?

如是:

  1. 如何在WSA中引用图像?
  2. 在不同项目中使用时,如何使用比例限定符等最好地解决缩放问题?

我没有使用数据库而且图像不是从外部服务下载的 - 我想在本地,应用程序或PCL中保存图像(实际上并不多).

编辑:我只是想显示图像.而已.这是一个静态的rolerdex,你不能添加新的人.我只是想显示5个人和他们的形象(在PCL中).如果图像是Windows应用商店应用,如何引用图像?

我有一个绑定,DataContext设置为PCL中的ViewModel.ViewModel聚合要从模型显示的数据.我绑定的属性是MyImage.忽略其他平台,Uri会是什么样子?其他一切都很好.

我真的只想帮助解决这三个问题,尽管我非常感谢所有答案!

wpf portable-class-library microsoft-metro windows-runtime

23
推荐指数
2
解决办法
7747
查看次数

在意外的时间调用了一个方法

我正在尝试使用GetFilesAsync迭代目录中的所有文件,但每次调用GetResults方法时,它都会抛出一个异常

System.InvalidOperationException:在意外时间调用了一个方法

代码很简单

var files = myStorageFolder.GetFilesAsync(); //runs fine
var results = files.GetResults(); //throws the exception
Run Code Online (Sandbox Code Playgroud)

我是Win 8 dev的新手,所以我可能会遗漏一些明显的东西.

编辑(已解决) 我正在运行我的控制台应用程序,但现在该程序运行异步,该files.GetResult()方法不再存在.

static void Main(string[] args)
{
   var files = GetFiles(myStorageFolder);
   var results = files.GetAwaiter().GetResults();//Need to add GetAwaiter()
}

static async Task GetFiles(StorageFolder sf)
{
   await sf.GetFilesAsync();
}
Run Code Online (Sandbox Code Playgroud)

exception local-storage windows-8 windows-runtime winrt-async

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

IValueConverter的异步实现

如果我想在IValueConverter中触发一个异步方法.

有没有更好的等待,然后通过调用结果属性强制它同步?

public async Task<object> Convert(object value, Type targetType, object parameter, string language)
{
    StorageFile file = value as StorageFile;

    if (file != null)
    {
        var image = ImageEx.ImageFromFile(file).Result;
        return image;
    }
    else
    {
        throw new InvalidOperationException("invalid parameter");
    }
}
Run Code Online (Sandbox Code Playgroud)

c# async-await c#-5.0 windows-runtime winrt-async

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

什么是Windows RT/Windows Store App对App.config的回答?

什么是去阅读和写作就像我们以前使用的App.config和Web.config中简单的配置数据的最佳方式<appsettings />可通过ConfigurationManager您的Windows 8/RT的Windows/Windows应用商店/ Windows的现代UI应用程序内之前,作什么用?

windows-8 windows-runtime windows-store-apps

22
推荐指数
2
解决办法
7485
查看次数

类属性不包括在sqlite数据库列中

我有一个实体类

  public class someclass
  {
      public string property1 {get; set;}
      public string property2 {get; set;}
      public string property3 {get; set;}
  }
Run Code Online (Sandbox Code Playgroud)

并使用sqlite连接类obj DB我正在创建表

  Db.CreateTableAsync<someclass>().GetAwaiter().GetResult();
Run Code Online (Sandbox Code Playgroud)

我想要实现的是,我不希望sqlite在表中创建列property3.有没有办法实现这个目标?

我正在使用SQLiteAsync库来存储Windows应用程序.

c# sqlite windows-runtime windows-store-apps sqlite-net

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

如何使用C#为我的WinRT应用程序生成MD5哈希码?

我正在创建一个MetroStyle应用程序,我想为我的字符串生成一个MD5代码.到目前为止我用过这个:

    public static string ComputeMD5(string str)
    {
        try
        {
            var alg = HashAlgorithmProvider.OpenAlgorithm("MD5");
            IBuffer buff = CryptographicBuffer.ConvertStringToBinary(str, BinaryStringEncoding.Utf8);
            var hashed = alg.HashData(buff);
            var res = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, hashed);
            return res;
        }
        catch (Exception ex)
        {
            return null;
        }
    }
Run Code Online (Sandbox Code Playgroud)

但它会抛出类型异常,System.ArgumentOutOfRangeException并显示以下错误消息:

No mapping for the Unicode character exists in the target multi-byte code page. (Exception from HRESULT: 0x80070459)

我在这做错了什么?

.net c# microsoft-metro windows-runtime

21
推荐指数
1
解决办法
8881
查看次数