silverlight-4.0

Why does Silverlight 4 Tools only give partial intellisense?

萝らか妹 提交于 2019-12-06 03:21:02
问题 I finally got Silverlight 4 Toolkit installed , referenced and working after the difficulty of finding the right namespace described in this question. But intellisense doesn't work fully: after I type " tk: ", it doesn't pop up the various controls I have available, but if I type a control name out, e.g. DockPanel , then it works, as shown below. It will even give me intellisense after I type tk:DropPanel, which is odd. How can I get intellisense to work in all cases for the Silverlight 4

Change culture of Silverlight application

不问归期 提交于 2019-12-06 03:06:58
问题 I am working on a Silverlight app at the moment. I have a few datagrids/textblocks where I use standard binding to show values, some of which are dates. e.g. <sdk:DataGrid AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding Path=MyCollection}"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn Binding="{Binding Path=Name, Mode=OneWay}" Header="Agent"/> <sdk:DataGridTextColumn Binding="{Binding Path=UpdateTime, Mode=OneWay}" Header="Update Time"/> </sdk:DataGrid.Columns> </sdk

Inconsistent Silverlight 4 ComboBox Dropdown Display

两盒软妹~` 提交于 2019-12-06 00:46:15
问题 I have a Silverlight 4 application with a ComboBox near the bottom of the form. There can be anywhere from about 30 to 100 items in the Dropdown. When I first open the ComboBox, there is no SelectedItem, the Dropdown opens upwards and it makes about 23 entries visible; it will continue this behavior each time I re-open the Dropdown, as long as I do not select an item. Once I select an item, everytime I open the ComboBox thereafter it always opens the Dropdown downwards, and makes only 3

Silverlight: Determine parent TreeViewItem?

陌路散爱 提交于 2019-12-06 00:22:15
I have a TreeViewItem . I'd like to get parent node of this item if any. However TreeViewItem.ParentTreeViewItem property is internal, and thus not accessible. There is no reason to hide this property from developers, however, someone very smart decided that way. How do I proceed? Is there any workarounds (reflection on private members is not working in SL)? Found an ugly, but working way: static TreeViewItem GetParentItem(TreeViewItem item) { for (var i = VisualTreeHelper.GetParent(item); i != null; i = VisualTreeHelper.GetParent(i)) if (i is TreeViewItem) return (TreeViewItem)i; return null;

How to bind maximum and minimum zoom levels in Bing Maps Silverlight

谁说胖子不能爱 提交于 2019-12-06 00:05:52
I would like to implement a custom zoom slider for a Bing Maps control in my silverlight application. I can set up the mechanics of it in a pretty straightforward way: <Slider ... Value="{Binding ZoomLevel, Mode=TwoWay, ElementName=MyMap}"/> However, I can't find a way to bind the Maximum and Minimum properties of the Slider to the maximum and minimum available zoomlevel for the map. I am using the default views (Road, Aerial) and no custom tilesets or anything fancy. I've tried something like this: Maximum="{Binding Path=Map.Mode.ZoomRange.To, Mode=TwoWay}" Minimum="{Binding Path=Map.Mode

Pass data to Child Window in Silverlight 4 using MVVM

心已入冬 提交于 2019-12-05 23:17:40
I have a datagrid with master detail implementation as follows: <data:DataGrid x:Name="dgData" Width="600" ItemsSource="{Binding Path=ItemCollection}" HorizontalScrollBarVisibility="Hidden" CanUserSortColumns="False" RowDetailsVisibilityChanged="dgData_RowDetailsVisibilityChanged"> <data:DataGrid.Columns> <data:DataGridTextColumn Header="Item" Width="*" Binding="{Binding Item,Mode=TwoWay}"/> <data:DataGridTextColumn Header="Company" Width="*" Binding="{Binding Company,Mode=TwoWay}"/> </data:DataGrid.Columns> <data:DataGrid.RowDetailsTemplate> <DataTemplate> <data:DataGrid x:Name="dgrdRowDetail

Get Row from Index in Silverlight DataGrid

风流意气都作罢 提交于 2019-12-05 23:09:47
I am trying to implement reordering rows in a Silverlight DataGrid. For this I am extending the default DataGridDragDropTarget , and I need to override and implement the following method: protected override DataGridRow ContainerFromIndex(DataGrid itemsControl, int index) { } How can I get the DataGridRow from the DataGrid and the Index? A slight improvement on Herzmeister's answer, see comments: protected override DataGridRow ContainerFromIndex(DataGrid itemsControl, int index) { var rowsPresenter = itemsControl.GetVisualDescendants().OfType<DataGridRowsPresenter>().FirstOrDefault(); if

Silverlight 4: Free Split Button

…衆ロ難τιáo~ 提交于 2019-12-05 21:59:13
I'm looking for free splitbutton control for silverlight. I've seen this blog however I cannot download it. Its blocked in my firewall. Do you know any free splitbutton for silverlight? Thank you Rich Bianco It is available for free in the Silverlight Toolkit. Download the latest Silverlight Toolkit from CodePlex. http://silverlight.codeplex.com/ Download the SplitButton Samples and Project. You may use the SplitButton project to compile your own version of the SplitButton.dll or use the Sample programs to study. (optional) http://dlaa.me/Samples/SplitButton/SplitButton.zip Add references

How do you bind to a command property with caliburn.micro?

主宰稳场 提交于 2019-12-05 21:05:12
I have a behavior that exposes several command properties. Typically I use MVVM Light and would just use a routed command in my view model and bind to those. However, this project is using Caliburn.Micro so I'm trying to do it the Caliburn.Micro way. Is there some syntax I can use on the Message.Attach to do this (is there any good documentation on the parser for Message.Attach)? Do I have to modify the behavior to expose events to make this work with Caliburn.Micro? Caliburn.Micro has its own mechanism for view/viewmodel communication as an alternative to commanding called Actions . You

Loop through rows in Silverlight DataGrid

倾然丶 夕夏残阳落幕 提交于 2019-12-05 20:57:48
I have a feeling i'm missing something obvious here, but i can not find a way to iterate through a DataGrids DataGridRow collection. I have a grid which has an itemssource of a collection of my class set. I am trying to iterate through the rows and highlight any rows that meet a certain condition but can't for the life of me see how. You don't want to iterate through the grid. That's old-skool WinForms thinking. The Grids in WPF and Silverlight have been redesigned with MVVM in mind; with separation of concerns. Instead of manipulating the grid, you work directly with your objects that are