silverlight

Silverlight ComboBox binding with value converter

守給你的承諾、 提交于 2019-12-25 08:52:14
问题 I'm attempting to convert the displayed value of a combobox by using its binding as a key to look for the value I would like to display. I can't seem to get it to work. The datacontext of my user control is MyObject. MyObject has a property "MasterDrawerId", which is the Id of "MyReferencedObject". Elsewhere in my application, accessible through a static property of my App.xaml.cs is a collection of "MyOtherObjects". "MyReferencedObject" has a foreign key relationship with the Id of

Manually set Validation error on Silverlight control

这一生的挚爱 提交于 2019-12-25 08:39:42
问题 I have a ComboBox which I cannot bind directly to (due to this bug), so I set it's SelectedItem from a Behavior I've written. Now, if the property bound to my behavior's SelectedValue (instead of the ComboBox's SelectedValue) is invalid (e.g. nothing is selected in the comboBox, when there should be), I want to notify the ComboBox to "go red", and display an errorcode. I know this is something the Binding system (if NotifyOnValidationError=true) handles automatically (it sets the bound

Custom DataContractSerializer

别来无恙 提交于 2019-12-25 08:38:52
问题 I want to serialize an object with DataMember attribute to be ignored on some properties. Say I have custom attribute MyIgnoreDataMember. I want properties marked with it to be invisible for my custom DataContractSerializer, but visible for the normal DataContractSerializer. And I have to use DataContractSerializer and nothing else. The code is a Silverlight app. Anyone have done subclassing DataContractSerializer successfully? 回答1: An answer to your question is complicated by the following

Streaming video & audio in Windows Phone 7

最后都变了- 提交于 2019-12-25 08:28:36
问题 I have an ASX stream that I would like to play on my Windows Phone 7. It appears that WP7 cannot handle client-side playlists, like an ASX file. So what do I do now? When I break into the ASX file, I see it's actually a mms:// stream with no file extension, so I can't even point to the raw file. How do I proceed from here? Is there a better option than the MediaElement control that will handle ASX files? More Info: My stream in question is audio/video, with WMA2/WVC1 encoding, respectively,

ListBox inside ListBox and selectedItem / Events

喜你入骨 提交于 2019-12-25 08:24:18
问题 I have now been stuck at this for some time so I though to ask the experts here. First the XAML: <ListBox Grid.Column="0" Tap="Some_Tap" SelectionChanged="Some_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <!-- the panel which covers a complete list item --> <StackPanel Orientation="Vertical"> <!-- start and end time for the travel route--> <Grid HorizontalAlignment="Center"> <Grid.ColumnDefinitions> <ColumnDefinition Width="100"/> <ColumnDefinition Width="100"/> <ColumnDefinition

Modify ServiceReferences.ClientConfig file using bat before deploying SilverLight solution

六月ゝ 毕业季﹏ 提交于 2019-12-25 08:17:32
问题 my team is developing a silverlight application and we are now switching our solution to https on our server but we would like to use http locally. So, in the XAP file that results when building the app there is a ServiceReferences.ClientConfig having the configuration for the web services that are referenced in the project. The issue is that I would like to have some configuration when I am running it locally and have some other configuration when I deploy it. We decided to alter the

CheckBox_Checked event

孤街浪徒 提交于 2019-12-25 08:09:24
问题 I eight check boxes in a Silverlight app, they are getting checked every time the windows that holds them is loaded, this keeps checking and un-checking the boxes without any user input. Is there a way to and a counter for instance, to make sure the CheckBox_Checked event is not used every time the window is loaded? Something like- private void checkBox1_Checked(object sender, RoutedEventArgs e) { int counter = 0 if(counter == 1) { //do nothing } else { //do something } counter1 = 1; } 回答1:

Silverlight Toolkit chart: Multiple series with bar and line

心已入冬 提交于 2019-12-25 08:02:21
问题 I am having problem to show the grid in a way that I wanted. But I am also not sure whether it is possible to do that in the Silverlight toolkit chart. So any help or direction on this would be appreciated. <Grid x:Name="LayoutRoot" Background="White"> <charting:Chart x:Name="myChart" Width="600" Height="400"> <charting:BarSeries Title="Tasks" ItemsSource="{Binding Path=Data1}" IndependentValueBinding="{Binding Month}" DependentValueBinding="{Binding Task}" DependentRangeAxis="{Binding

Estimate position and Width/Height of rendered UserControl

亡梦爱人 提交于 2019-12-25 07:48:43
问题 I have a UserControl (boxes) that can have varying size based on the number of items in its ItemsControl . Many such usercontrols are added to a Canvas programmatically. I need to draw arrows interconnecting these usercontrols. What is the best way to get the origin coordinates of the control w.r.t the Canvas and the rendered Width / Height so that I can figure out the arrow start and endpoints. 回答1: Canvas provides the coordinates of each control via Canvas.Left and Canvas.Top attached

NetConnect fails silently in Flash when called from SilverLight

时光总嘲笑我的痴心妄想 提交于 2019-12-25 07:27:39
问题 This is a complex question, because there are a lot of moving parts. My apologies in advance. I'm trying to write a Silverlight control that hosts a Flash camera and microphone (since Silverlight doesn't support these things natively, worse luck). I've written a short little Flex application ("WLocalWebCam.swf") which handles the camera, and exposes two external methods: connect(uri:String, streamName:String), and disconnect(). I can call these successfully through JavaScript as follows