小编Kal*_*yan的帖子

在Windows Phone 8.1 Universal Apps中隐藏状态栏

如何在Windows Phone 8.1(C#,XAML)中隐藏状态栏?

Windows Phone 8它被设置做shell:SystemTray.IsVisible="False"任何页面.但它没有Windows Phone 8.1

c# winrt-xaml windows-phone-8.1 win-universal-app

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

Windows Phone模拟器无法正常工作

当我尝试开始调试我的Windows Phone 8 app时Emulator WVGA 512MB出现以下错误消息

The Windows Phone Emulator wasn't able to connect to the Windows Phone operating system:

The emulator couldn't determine the host IP address, which is used to communicate with the guest virtual machine.

Some functionality may be disabled.

并且模拟器总是显示The Windows Phone OS is starting... 无法理解什么是问题.请指教.

windows-phone-8-emulator

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

使用HTML Action Link定位div

我是ASP/MVC的新手,我无法弄清楚如何div在HTML标记中链接到一个页面.这是纯HTML中的当前链接.我想完成这个,但是用剃刀语法

<div class="col-md-2">
    <a href="ambulance.html">
        <div class="amb item">
            <div class="tiletext">AMB</div>
            <div class="tilesubtext">Ambulance</div>
        </div>
    </a>
</div>
Run Code Online (Sandbox Code Playgroud)

我一直在寻找行动链接,但如果有更好的方法来实现这一目标,我愿意接受它!

html asp.net-mvc html5 razor

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

MessageDialog - 需要等待用户输入

我有一个ViewModel,它在同步方法中实例化一个事件.该事件向UI发出信号,表示在继续之前我们需要来自用户的"是"或"否"回答.

我试图显示MessageDialog并等待用户提供答案 - 是或否.我很难做到这一点.我目前正UnauthorizedAccessException试图这样做.

以下是UI中的代码:

async Task<bool> Instance_SwitchConfirmation(string question)
{
    MessageDialog md = new MessageDialog(question);
    md.Commands.Add(new UICommand("Yes", CommandInvokedHandler));
    md.Commands.Add(new UICommand("No", CommandInvokedHandler));
    md.ShowAsync();

    return this.canSwitch;
}

async void CommandInvokedHandler(IUICommand command)
{
    this.canSwitch = command.Label == "Yes" ? true : false;
}
Run Code Online (Sandbox Code Playgroud)

我试过了:

var uiContext = TaskScheduler.FromCurrentSynchronizationContext();
Task.Factory.StartNew(() => {
    MessageDialog md = new MessageDialog(question);
    md.Commands.Add(new UICommand("Yes", CommandInvokedHandler));
    md.Commands.Add(new UICommand("No", CommandInvokedHandler));
    md.ShowAsync();
}, 
new System.Threading.CancellationToken(), 
TaskCreationOptions.PreferFairness, uiContext);
Run Code Online (Sandbox Code Playgroud)

但这失败了同样的例外.

最后,如果我只是等待MessageDialog,则不显示对话框并且UI线程锁定.

MessageDialog md = new MessageDialog(question);
md.Commands.Add(new UICommand("Yes", CommandInvokedHandler));
md.Commands.Add(new …
Run Code Online (Sandbox Code Playgroud)

c# messagedialog async-await microsoft-metro

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