silverlight-4.0

How can I get a screen resolution of Device (Windows Phone)

北慕城南 提交于 2019-11-29 13:33:34
How can I get a screen resolution of Device from settings (Windows Phone) ? public void GetScreenResolution() { string ScreenWidth = Application.Current.Host.Content.ActualWidth.ToString(); string ScreenHeight = Application.Current.Host.Content.ActualHeight.ToString(); MessageBox.Show(ScreenWidth + "*" + ScreenHeight); } This may be a better way to know what screen resolution is your app running on. if(App.Current.Host.Content.ScaleFactor == 100) { // WVGA } else if (App.Current.Host.Content.ScaleFactor == 160) { // WXGA } else if (App.Current.Host.Content.ScaleFactor == 150) { // 720p }

Convert Audio samples from bytes to complex numbers?

隐身守侯 提交于 2019-11-29 12:28:12
Greetings everyone, I am currently developing a chromatic tuner for instruments/voice in Silverlight with a C# back-end. I am in the beginning stages and am having issues in grabbing the audio data. I am using an AudioSink class to write the audio to a memory stream when the live capture starts. The problem I am having is converting those bytes in the stream to complex numbers so that it can be fed into a FFT algorithm. I have tried the various way discussed in this post Problem to convert byte array to double but am not sure which method should be used. Any suggestions on going from a byte

HLSL for getting cylinder effect

[亡魂溺海] 提交于 2019-11-29 12:16:58
I need to write an application with Silverlight 4 and need to show images like wrapped on cylinder. I need some HLSL code, as I wont to do that with Effects of Silverlight. I don't wont to do that with 3D libarries for silverlight. I only need HLSL code for changing pixels. I need for my image to look like this Thanks. This seems to be the effect you want, you may wish to change the 0.2 value to increase or decrease the effect or make this adjustable in your shader but that's a simple change to do. I'd recommend Shazzam if your not using it for writing shaders for WPF or Silverlight. sampler2D

WpfToolkit DataGrid does not work in Windows Phone 7

旧时模样 提交于 2019-11-29 11:13:54
I am trying to use WpfToolkit DataGrid in Windows Phone 7 project (Silverligt 4) and it's not working. Here is the XAML: <UserControl x:Class="SilverlightControls.Grid" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:wtk="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit" d:DesignHeight="480" d:DesignWidth="480"> <Grid x:Name="LayoutRoot" Background="

How to transfer large amount of data using WCF?

霸气de小男生 提交于 2019-11-29 11:09:18
We are currently trying to move large amounts of data to a Silverlight 3 client using WCF with PollingDuplex. I have read about the MultiplerMessagesPerPoll in Silverlight 4 and it appears to be quite a bit faster. Are there any examples out there for me to reference (using MultipleMessagesPerPoll)? Or maybe some good references on using Net.TCP? Maybe I should be taking a completely different approach? Any ideas or suggestions would be greatly appreciated. Thanks! KodeKreachor Streaming serialized response chunks works well: Your WCF binding configuration would resemble the following:

Silverlight 4 / .NET 4 Debugging resource strings

本小妞迷上赌 提交于 2019-11-29 10:49:18
问题 I recently encountered a strange thing. On some of my company's servers when an exception message is printed out (yes, bad, I know. It's for debugging), the actual message isn't displayed. Instead it displays the key for an external string resource and says that "Debugging resource strings are unavailable" After some research I've come up with the following: In release mode, Silverlight does not package the xap with the dlls containing the actual error messages in order to save space. I've

Why is the dictionary debug visualizer less useful in Visual Studio 2010 for Silverlight debugging?

心已入冬 提交于 2019-11-29 09:50:34
I was debugging in Visual Studio 2010, which we just installed and trying to look at a dictionary in the quick watch window. I see Keys and Values, but drilling into those shows the Count and Non-Public members, Non-Public members continues the trail and I never see the values in the dictionary. I can run test.Take(10) and see the values, but why should I have to do that. I don't have VS 2008 installed anymore to compare, but it seems that I could debug a dictionary much easier. Why is it this way now? Is it just a setting I set somehow on my machine? Test code: Dictionary<string, string> test

How can I convert WriteableBitmap to BitmapImage?

会有一股神秘感。 提交于 2019-11-29 09:25:05
BitmapImage bitmapImage = new BitmapImage(new Uri("arka_projects_as_logo.png", UriKind.Relative)); Image uiElement = new Image() { Source = bitmapImage }; ScaleTransform t = new ScaleTransform() { ScaleX = 0.2, ScaleY = 0.2 }; WriteableBitmap writeableBitmap = new WriteableBitmap(uiElement,t); I want to insert the result of this conversions (writeableBitmap) into System.Windows.Controls.Image. When I do this: Image arkaImage = new Image() { Source = writeableBitmap }; arkaImage isn't shown at all. What can be done to make it work? WriteableBitmap wb = .. using (MemoryStream ms = new

Prism for Silverlight: How to maintain views in a specific order inside a region

 ̄綄美尐妖づ 提交于 2019-11-29 08:13:19
I am creating sort of a "Navigation panel" (which is actually an ItemControl) for SL and using Regions to allow each module to add his link to the panel. Problem is that modules loading is inconsistent and thus order of links in the panel can change according to modules loading order. Restricting the modules order is out of the question. Other feasible option is the order the region's Views Collection that is binded to the ItemControl, the problem is that ViewCollection is very limited, so ordering it is pretty hard. Did I miss an option, do you have an idea? Thanks Ariel In Prism4 you just

How to set focus on TextBox in Silverlight 4 out-of-browser popup

烈酒焚心 提交于 2019-11-29 07:58:12
I have a simple ChildWindow popup in Silverlight 4 (beta). Important: This is an out-of-browser application. i want to auto set focus on a TextBox control when the window opens. I've tried a couple things : The following code doesn't seem to do anything. I don't think the control is ready to be focussed after 'Loading'. private void ChildWindow_Loaded(object sender, RoutedEventArgs e) { textBox1.Focus(); } This works, but its klunky. private void ChildWindow_GotFocus(object sender, RoutedEventArgs e) { if (_firstTime == true) { textBox1.Focus(); _firstTime = false; } } Isn't there a better way