silverlight

Setting focus to a textbox on load of Windows Phone 7 app

自作多情 提交于 2019-12-23 12:46:31
问题 I have a TwoWay data-bound textbox inside my page. I want to do something pretty simple, but I can't for the life of me work out how to do it. When the page loads, I want to set the focus to the textbox if it doesn't have any text in it. protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { if (tbSearch.Text == "") tbSearch.Focus(); } This doesn't work. It doesn't fail, it just doesn't do anything. Am I doing something strange wrong? I've also tried putting

How to use messagebox to output debug information

跟風遠走 提交于 2019-12-23 12:46:17
问题 I am using a MessageBox to try and do some manual debugging and this is all i have come up with, how am I supposed to make it work? private void DisplayMessageBoxText() { MessageBox.Show("Alert Message"); } 回答1: Ive used http://www.gurock.com/smartinspect/ a lot, its great for logging various changes, can grab all sorts of objects, statuses and the like. the plus side is you can leave it in your code and if you have problems later, just connect in the listener and see whats happening.

Is it possible to call matlab functions from Silverlight / C#?

我是研究僧i 提交于 2019-12-23 12:43:18
问题 Is it possible to call matlab functions from Silverlight / C# ? 回答1: If you have an assembly (dll) that can interpret Mathlab calls, you should be able to include that assembly in your project and compile it with the rest of your application. Obviously, you won't be able to run Silverlight side-by-side to interface with an installed instance of Matlab (unless the API is exposed through COM interop and using Silverlight 4, but that could get messy). The Web API on sourceforge, as mentioned by

Is it possible to call matlab functions from Silverlight / C#?

拜拜、爱过 提交于 2019-12-23 12:41:03
问题 Is it possible to call matlab functions from Silverlight / C# ? 回答1: If you have an assembly (dll) that can interpret Mathlab calls, you should be able to include that assembly in your project and compile it with the rest of your application. Obviously, you won't be able to run Silverlight side-by-side to interface with an installed instance of Matlab (unless the API is exposed through COM interop and using Silverlight 4, but that could get messy). The Web API on sourceforge, as mentioned by

Silverlight HTML Bridge printing window.print() blank pages

余生颓废 提交于 2019-12-23 12:33:27
问题 I am using HTML bridge window.print() to print range between 20-30. The client says it is printing blank pages. We can only reproduce it on their machine. This is the code in xaml that combines all the pages in one page and prints it. This code works and prints all pages for me. We need this only on IE I am using windows 8 and IE 10. But for the client it prints one blank page with the header and footer url. It works correctly if he prints the current page or prints all the pages from start

TimeSpan string format in Windows Phone XAML

社会主义新天地 提交于 2019-12-23 12:33:00
问题 I'm attempting to apply a XAML StringFormat to a TimeSpan property. NOTE This question applies to Windows Phone . For WPF, the correct syntax is: Text="{Binding ElapsedTime,StringFormat={}{0:m\\:ss}}" For Silverlight, it needs single-quotes: Text="{Binding ElapsedTime,StringFormat='{}{0:m\\:ss}'}" But for Windows Phone, no matter what I have tried, the output is always the full "00:00:00.0000000". StringFormat='m\\:ss' StringFormat='{}{0:m\\:ss}' StringFormat='m\:ss' StringFormat=m\\:ss Have

IIS Smooth Streaming in a WPF application

十年热恋 提交于 2019-12-23 12:30:08
问题 How can I play IIS Smooth Streaming video in a WPF application. I know Silverlight has built-in support for it, but I can't find much information for WPF. Will the MediaElement control support this in WPF 4? 回答1: Unless something has changed very recently, the only Windows Smooth Streaming client available is Silverlight. There is no support for Smooth Streaming in Windows Media Player or for other standalone Windows applications. 来源: https://stackoverflow.com/questions/2409930/iis-smooth

Show ComboBox group header for Silverlight

对着背影说爱祢 提交于 2019-12-23 12:22:45
问题 I want to show a ComboBox with OPTGROUP style header gruopings in Silverlight. Every website I find (including questions on SO) that sovle this link to an outdated link and, handily, show no code snippets for me to work from. E.g.: So how do I do this? 回答1: See my similar question: How to show group header for items in Silverlight combobox? I put dummy entries in collection source to indicate the group header and then modified DataTemplate to show the group headers in different way and normal

WP7: navigate twice back

一世执手 提交于 2019-12-23 12:17:05
问题 is there a way to navigate two pages back in Windows Phone 7? I know the URI, but I'd like to clear the navigation stack. 回答1: Yes you can programmatically walk back the stack. I would recommend reading this guidance doc on this topic: http://windowsteamblog.com/windows_phone/b/wpdev/archive/2010/12/13/solving-circular-navigation-in-windows-phone-silverlight-applications.aspx Thanks, Stefan Wick - Microsoft Silverlight 回答2: The easiest way to do this is like this: NavigationService

Browser.HtmlPage.Window.Navigate is blocked but HyperlinkButton isn't - why?

萝らか妹 提交于 2019-12-23 11:48:29
问题 I have a certain UI element, which when clicked should navigate to another URL. I tried handling the mouse down event and execute something like this: System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("http://google.com"), "_blank"); However, this gets blocked by the browser (I tried both Chrome and Firefox) unless I disable the popup blocker. I did some research and it seems that the browser blocks navigations that don't occur as a result of user interaction and as far as the browser