silverlight-4.0

creating a binding dynamically and setting it to a string object that was created silverlight

ε祈祈猫儿з 提交于 2019-12-11 07:08:12
问题 I wanted to create binding dynamically and set this binding to a string object that was created on-the-fly and bind this to the displaymemberpathproperty of a combo box. How do I go about doing this? Here is my code so far but doesn't seem to work. What will I be setting the path property of the binding to (i.e. the reason i'm doing it this way is cause I have number of combo boxes that are using this one method): private void ComboValue_DropDownClosed(object sender, EventArgs e) { ComboBox

Silverlight ChildWindow does not reposition correctly

那年仲夏 提交于 2019-12-11 07:06:34
问题 I am using the ChildWindow (Silverlight) which also contains some expander controls. In one case, when the expander control expands, the bottom of the child window expands down out the screen on the bottom, but still leaves room on the top. How can I re-position a child window in order to center it in the screen, as if I just opened the childwindow? (That would be easy, but I don't think doable) (manual intervention) I've gone through RenderTransform of the the ContentRoot, and I have six

2nd time binding to PointCollection not being rendered

狂风中的少年 提交于 2019-12-11 07:04:24
问题 I have an ItemsControl whose ItemsSource I assign (via code) an ObservableCollection (lets call it Items) of INotifyPropertyChanged objects (data model). This data model has a PointCollection property. The view (XAML) binds to this PointCollection on a PolyLine (on the Points attribute). Initially when i set this Items collection to the ItemsControl.ItemsSource, i can see that the lines are indeed rendered. Issue: When I set the ItemsControl.ItemsSource to something else (like another

Drag/drop from ListBoxDragDropTarget to PanelDragDropTarget

寵の児 提交于 2019-12-11 06:56:12
问题 Using the Silverlight 4 toolkit, is it possible to drag and drop from a ListBox to a Canvas (and get an event on the drop into the Canvas)? I was able to write code to drag/drop from a wrap panel inside a PanelDragDropTarget to a canvas but the event handler did not trigger when the drop occurred. When I tried to drag/drop from a ListBox inside a ListBoxDragDrop to the Canvas inside the PanelDragDropTarget, the drop did not occur (and the event handler didn't trigger). While dragging over the

Styles Don't Update

怎甘沉沦 提交于 2019-12-11 06:55:32
问题 I am trying to use theming within my application, but I am having a problem with my styling not being applied correctly. I run the following lines of code: App.Current.Resources.MergedDictionaries.Clear(); ResourceDictionary rd = new ResourceDictionary(); rd.Source = new Uri( "/Style2.xaml", UriKind.RelativeOrAbsolute ); App.Current.Resources.MergedDictionaries.Add( rd ); Do I need to refresh the page? If so, how do I do that in Silverlight? Thanks! Blake 回答1: Yes you need to "Refresh the

Why does silverlight run into an endless loop when printing document longer than 1 page? .HasMorePages = true

故事扮演 提交于 2019-12-11 06:38:54
问题 My 1st question here on stackoverflow. I am trying to print a long grid, which was dynamically generated. pdoc.PrintPage += (p, args) => { args.PageVisual = myGrid; args.HasMorePages = false; }; When I use args.HasMorePages = false; , it prints the first page of the grid as it should (although it takes some time, since it sends a 123MB big bitmap to the poor printer - thanks for silverlight 4's print feature implementation.). However, when I enable printing more pages with args.HasMorePages =

MVVM-Light EventToCommand Behavior for CheckBox Checked/Unchecked in Silverlight

北城以北 提交于 2019-12-11 06:36:06
问题 I would like to handle the Checked and Unchecked events of a Checkbox control and execute a command in my ViewModel. I wired up an EventTrigger for both the Checked and Unchecked events as follows: <CheckBox x:Name="chkIsExtendedHr" IsChecked="{Binding Schedule.Is24Hour, Mode=TwoWay}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Checked"> <GalaSoft_MvvmLight_Command:EventToCommand CommandParameter="{Binding IsChecked, ElementName=chkIsExtendedHr}" Command="{Binding Path=SetCloseTime,

virtualizing treeview in silverlight

梦想与她 提交于 2019-12-11 06:25:11
问题 I am using silverlight toolkit treeview to show set of data. It has 1000 elements and some of the child elements have as much as 500 child elements as well. It takes almost a minute to load the data and show it in treeview. Does the tree view have virtualization? If it does, could some one point me to a sample or code snippet please? Following is the XAML <controls:TreeView Grid.Column="0" VerticalAlignment="Stretch" ItemsSource="{Binding People}" > <controls:TreeView.ItemTemplate> <common

Recording PCM audio in silverlight 4

允我心安 提交于 2019-12-11 06:17:54
问题 I have encountered a strange behavior in Silverlight application and couldn't be able to resolve it after trying many hours. Since I cannot access AudioFormat 's internal constructor in my code (even using reflection caused silverlight security policies to raise an exception), How can I change audio format (in my class which is derived from AudioSink class. Right now, I override the method in my MemoryAudioSink class as follows: protected override void OnFormatChange(AudioFormat audioFormat)

Silverlight 4 Screen Capture

一世执手 提交于 2019-12-11 06:15:47
问题 I'm writing a timesheet helper utility in Silverlight 4. This will be a trusted out of browser application that will periodically ask the user (with a SL4 Notification Window) what they have been working on. What I'd like to do is have it capture images of their desktop (or better yet, active window) from time to time in order to remind them of what they have been working on since they last submitted their status report. Is this idea even possible? Do I need to use COM? If so, what COM