Changing the background color of a metro style app has no effect

I am trying to change the background color of my application in visual studio (XAML) to White (or, ApplicationPageBackgroundTheme / or whatever it's called) and it doesn't work. When I debug, it just shows a black background. When I go to the Devices pane and select the default color theme to "Light", it makes everything on the screen white, even the text and the background.

更改metro风格应用程序的背景颜色不起作用

我试图将我的应用程序在Visual Studio(XAML)中的背景颜色更改为白色(或ApplicationPageBackgroundTheme /或任何它所称的),但它不起作用。 当我调试时,它只显示黑色背景。 当我转到“设备”窗格并选择默认颜色主题为“浅色”时,它会使屏幕上的所有内容变为白色,即使是文本和背景。 当我更改xaml中的颜色背景时,在运行时它会变回黑色! 我搜索了,但没有找到任何信息。 这是一个已知的错误? 这从来没有发生过。 我

Sorted Dictionary sorted on value in C# (LRU cache)

I want to implement an LRU cache , where least recently used elements will be evicted asynchronously . My current idea is to use a Dictionary to store the <key,value> pairs , and to keep track of the times of accesses of the objects, to keep a SortedDictionary <key, timestamp> . The idea is for the async thread to get the LRU items from the SortedDictionary and remove from the cache

按C#中的值排序的排序字典(LRU缓存)

我想实现一个LRU cache ,其中最近使用最少的元素将被异步驱逐。 我目前的想法是使用Dictionary存储<key,value>对,并跟踪访问对象的次数,以保持SortedDictionary <key, timestamp> 。 这个想法是让异步线程从SortedDictionary获取LRU项并从缓存中移除。 但是为了这个工作, SortedDictionary需要按价值排序,而不是。 我可以使用单独的SortedList而不是SortedDictionary来保持时间戳上的{key和timestamp}排序

Windows global hook for text box focus

I'm building a virtual keyboard for Windows (can't use the default keyboard, I need to block some keys and add custom ones) and I planned on using global hooks in order to display/hide the keyboard when needed. I already have a simulated keyboard in WPF and I use the GotFocus/LostFocus methods for making it appear/disappear. But the problem is the keyboard should also work with third-p

用于文本框焦点的Windows全局钩子

我为Windows构建了一个虚拟键盘(不能使用默认键盘,我需要阻止某些键并添加自定义键盘),并且我计划使用全局挂钩来在需要时显示/隐藏键盘。 我在WPF中已经有了一个模拟键盘,并且我使用GotFocus / LostFocus方法使它看起来/消失。 但问题是键盘还应该与第三方应用程序(即Reader)一起工作,所以我需要它在没有附加代码的情况下工作。 我查看了HCBT_SETFOCUS,但它只给我提供焦点的窗口,而不是UI元素。 当文本框获得/失

Tracking global mouse events for drag/drop handling

Possible Duplicate: Drag Drop from .NET application to Explorer In my application it's required that users can have ability of drag & drop from files from ListView on the from to Windows Explorer. This files locates on server so I need download them to place which user point. For this I decided to set hook WH_MOUSE_LL for tracking global mouse events to get handle of folder where us

跟踪全局鼠标事件以进行拖放处理

可能重复: 从.NET应用程序拖放到资源管理器 在我的应用程序中,需要用户能够从ListView中的文件拖放到Windows资源管理器。 这些文件位于服务器上,因此我需要下载它们以放置哪个用户点。 为此,我决定设置钩子WH_MOUSE_LL来跟踪全局鼠标事件,以获取用户放置文件的文件夹句柄,然后使用它获取加载文件的绝对路径。 这里是带HOOK功能的id DLL: [StructLayout(LayoutKind.Sequential)] public class Mous

Omit an edge from a shape in WPF (C# code)?

I'm creating a speech bubble control for my application, and the way I'm looking to do it is to use a rectangle with rounded corners, then place a shape on top that forms the "origin" of the speech bubble. These are arranged in a Grid so that the bubble resizes to its content whilst keeping the origin shape constant (ie it won't stretch). Now, here's my question; is i

从WPF中的形状(C#代码)省略边缘?

我为我的应用程序创建了一个语音气泡控件,我期望的方法是使用带圆角的矩形,然后在顶部放置一个形状,以形成气泡的“起源”。 这些被安排在网格中,以便气泡调整到其内容,同时保持原点形状不变(即不会伸展)。 现在,这是我的问题。 是否有可能在WPF中创建一个路径,省略其中一个边(即,从该边删除笔划,但填充仍然存在)? 我知道我可以通过将两个形状放在彼此顶上来做到这一点,但我正在寻找一种尽可能简单的解决方案!

Visual Studio 2013 doesn't discover unit tests

I have a simple solution in visual studio 2013 that is composed by one web project, one library project and one unit test project. When I open the solution and try to run the unit tests they are not discover by visual studio. To run the tests I try to go to the menu and choose Test -> Run -> Run all tests or by opening the test explorer window. By those to methods visual studio doesn'

Visual Studio 2013不会发现单元测试

我在Visual Studio 2013中有一个简单的解决方案,它由一个Web项目,一个库项目和一个单元测试项目组成。 当我打开解决方案并尝试运行单元测试时,它们不会被visual studio发现。 要运行测试,我尝试进入菜单并选择测试 - >运行 - >运行所有测试或打开测试资源管理器窗口。 通过那些方法,visual studio在解决方案中没有发现任何测试。 首先创建一个简单的单元测试项目并尝试运行测试,Visual Studio知道发现测试并且

Why does visual studio 2012 not find my tests?

I have some tests that use the built in Microsoft.VisualStudio.TestTools.UnitTesting , but can not get them to run. I am using visual studio 2012 ultimate. I have a solution of two projects; One has tests, using Microsoft.VisualStudio.TestTools.UnitTesting , [TestClass] before the class, [TestMethod] before the test methods and reference Microsoft.VisualStudio.QualityTools.UnitTestFramework

为什么visual studio 2012找不到我的测试?

我有一些测试使用内置的Microsoft.VisualStudio.TestTools.UnitTesting ,但无法让它们运行。 我正在使用Visual Studio 2012终极版。 我有两个项目的解决方案; 一个测试, using Microsoft.VisualStudio.TestTools.UnitTesting , [TestClass]之前的类, [TestMethod]之前的测试方法和参考Microsoft.VisualStudio.QualityTools.UnitTestFramework (版本10.0.0.0,运行时版本v2.0.50727)。 我已经尝试了网络框架3.5,4和4.

Get Facebook's Application Access Token

I have to use Facebook's notification for my web app. Facebook Graph API requires the Application Access Token for this action. Is there a way to get this token by code (C# SDK) or is this generated by Facebook a single time? Is this token static (and secret) or with expire datetime? For info: https://developers.facebook.com/tools/access_token/ - App Token, not User Token! Thanks Th

获取Facebook的应用程序访问令牌

我必须使用Facebook的通知为我的网络应用程序。 Facebook Graph API需要此操作的应用程序访问令牌。 有没有一种方法可以通过代码(C#SDK)获取该令牌,或者是由Facebook单次生成的? 这个标记是静态的(和秘密的)还是带有过期的日期时间? 有关信息:https://developers.facebook.com/tools/access_token/ - 应用程序令牌,而不是用户令牌! 谢谢 答案是代码的动态方式: var fb = new FacebookClient(); dynamic

Unable to extend facebook access token

I am trying to extend my facebook access token, and following is what I did. However, i wasn't able to get the token extended, and when I check the facebook accesstoken debugger it still shows that the token is expiring in an hour. any ideas? private string appId = "my app id"; private string appSecret = "my app secret"; private string returnUrl = "http://localhost:1868/callba

无法扩展Facebook访问令牌

我试图扩展我的Facebook访问令牌,以下是我所做的。 但是,我无法获得令牌扩展,并且当我检查facebook accesstoken调试器时,它仍然显示令牌将在一小时内过期。 有任何想法吗? private string appId = "my app id"; private string appSecret = "my app secret"; private string returnUrl = "http://localhost:1868/callback"; private string _scope = "user_about_me,publish_stream,user_videos,user_ph

Facebook API to get access token

I have a requirement where I want to use Facebookaccess token using only APIs. I have seen methods which works using web requests and responses to get the Facebook API and they also use redirect URIs. But I cant really use redirect URI since I want to use it in a azure worker role. Something like: facebook a=new facebook(); a.appid=""; This is just a visualization but any help would be gr

Facebook API获取访问令牌

我有一个要求,只需要使用API​​的Facebookaccess令牌。 我见过使用Web请求和响应来获取Facebook API的方法,他们也使用重定向URI。 但我不能真正使用重定向URI,因为我想在一个天蓝色的辅助角色中使用它。 就像是: facebook a=new facebook(); a.appid=""; 这只是一个可视化,但任何帮助都会很棒。 编辑: 以下回答有帮助。 如果我在浏览器中使用以下uri https://graph.facebook.com/oauth/access_token?client_id