silverlight

HLSL Shader to Subtract Background Image

ⅰ亾dé卋堺 提交于 2019-12-24 03:58:08
问题 I am trying to get an HLSL Pixel Shader for Silverlight to work to subtract the background image from a video image. Can anyone suggest a more sophisticated algorithm than I am using because my algorithm isn't doing it correctly? float Tolerance : register(C1); SamplerState ImageSampler : register(S0); SamplerState BackgroundSampler : register(S1); struct VS_INPUT { float4 Position : POSITION; float4 Diffuse : COLOR0; float2 UV0 : TEXCOORD0; float2 UV1 : TEXCOORD1; }; struct VS_OUTPUT {

Where do I put the logic for my ICommand?

我怕爱的太早我们不能终老 提交于 2019-12-24 03:53:49
问题 I've recently started using the MVVM pattern in silverlight, and i'm not sure if i am using it correctly. GUI I currently have a MainView that has combobox of stock market sectors. When the user selects a sector (eg ENERGY) and clicks the Add button a list of stocks for that sector are displayed in a listbox. By the side of each stock in the listbox is a remove button that allows you to remove the individual stock from the listbox. I have implemented the following ViewModels. (Below is just

Where do I put the logic for my ICommand?

核能气质少年 提交于 2019-12-24 03:53:00
问题 I've recently started using the MVVM pattern in silverlight, and i'm not sure if i am using it correctly. GUI I currently have a MainView that has combobox of stock market sectors. When the user selects a sector (eg ENERGY) and clicks the Add button a list of stocks for that sector are displayed in a listbox. By the side of each stock in the listbox is a remove button that allows you to remove the individual stock from the listbox. I have implemented the following ViewModels. (Below is just

Issue Trying To Get Button Border to Animate on Click

半城伤御伤魂 提交于 2019-12-24 03:48:17
问题 I'm trying to animate the border of a button, but having trouble getting it to work. Here's the XAML I setup: <Button x:Name="Btn"> <Button.Triggers> <EventTrigger RoutedEvent="Button.Click"> <BeginStoryboard> <Storyboard Duration="100" AutoReverse="True" Storyboard.TargetName="Btn" Storyboard.TargetProperty="BorderBrush"> <ColorAnimation To="Yellow" /> </Storyboard> </BeginStoryboard> </EventTrigger> </Button.Triggers> </Button> I'm getting this error: Failed to assign to property 'System

Specify HTTPS for custom WCF Binding

天涯浪子 提交于 2019-12-24 03:36:45
问题 I have an custom binding defined as follows: <customBinding> <binding name="binaryHttpBinding"> <binaryMessageEncoding /> <httpTransport /> </binding> This is used for an endpoint that a Silverlight 3 application uses to connect to the service. This works fine under HTTP, but i would like to specify this binding to use HTTPS and I am kinda lost on how to define that. I am using selfSSL.exe from the IIS Resource Toolkit to setup an SSL on my local machine. I can browse the svc file fine

Custom Checkbox style for WPF

笑着哭i 提交于 2019-12-24 03:34:08
问题 I would like to skin a wpf default checkbox to something custom. Since it does not really make sense to start off a entirely new control, i'd like to override the Windows Chrome template binding for the Bulletchrome sub component of the checkbox. However I cannot do this like I can with checkboxes for example. tried using something like this to override the default style, but it seems to not compile like this <Style x:Key="cb_BULLETSTYLE" TargetType="{x:Type BulletDecorator}"> <Setter

WebClient Retry

廉价感情. 提交于 2019-12-24 03:29:30
问题 Is it possible to retry a webclient request? On the odd occasion my application will throw an error when attempting to connect to an xml web service but if I retry, it works OK. I'd like it to retry 2 times before throwing an error unless someone has a better solution :) private void ApplicationBarLogin_Click(object sender, EventArgs e) { settings.UsernameSetting = Username.Text; if (RememberPassword.IsChecked == true) { settings.PasswordSetting = Password.Password; settings

Silverlight XML Save does not overwrite the entire file

霸气de小男生 提交于 2019-12-24 03:22:18
问题 The best way to explain my problem is by a example. I have a Xml file with some elements in it. When I remove a element, I save the file again and this problem occurs: Before save <?xml version="1.0" encoding="utf-8"?> <ElementTree> <Elements1 /> <Elements2> <Element Name="TestElement" ID="4efa7cc9-a89a-429b-81f4-b00cde729f24" /> </Elements2> <Elements3 /> </ElementTree> After save <?xml version="1.0" encoding="utf-8"?> <ElementTree> <Elements1 /> <Elements2 /> <Elements3 /> </ElementTree>D=

Bad Request RestSharp Windows Phone 7

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 03:21:48
问题 I've been trying to make a WCF web service that enters a certain set of data into a database and it can be used in Windows Phone 7. In the configuration file there are two endpoints: json and soap. Here's the code for both of them: <service name="LiveAndesWCF.SightingServiceRest" behaviorConfiguration="MetadataBehavior"> <endpoint address="soap" binding="basicHttpBinding" contract="LiveAndesWCF.ISightingServiceRest"/> <endpoint address="json" behaviorConfiguration="WebBehavior" binding=

Silverlight DependencyProperty.SetCurrentValue Equivalent

谁都会走 提交于 2019-12-24 03:19:30
问题 I'm looking for a SL4 equivalent to .NET 4's SetCurrentValue API, which would appear to be exactly what I need for my scenario. In short, I'm writing an attached behavior that updates the value of a given property at appropriate times. However, I don't want it to overwrite any bindings that are set on that dependency property. I merely want to push that value to the property (and therefore have any bindings refresh based on that value). From what I can tell, there's no easy way to do this yet