silverlight-toolkit

Get drop index in Silverlight drag / drop

你。 提交于 2019-12-07 10:47:16
问题 This article shows how to implement a copy operation on a drop event. I'd like to do the same but I want my dropped item to appear in the collection according to where it was placed on the UI. So I need the StartIndex much like on a NotifyCollectionChangedEventArgs when an ObservableCollection changes. In the article you'll see that eventually you get a SelectionCollection object whose items have an Index property. But unfortunately this is the index of the source collection (where it was

Adding WP7 ContextMenu programmatically

萝らか妹 提交于 2019-12-07 10:33:29
问题 I'm loading elements on a page dynamically (reading the contents of an XML file). The dynamic content is loaded into a StackPanel . Each element of the content consists of a TextBlock and one other UI element, so for each pair I create a new StackPanel which is then added to the parent StackPanel . The code looks like this: TextBlock header = new TextBlock() { Text = "Heading 1", HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Top, Foreground =

Adding a horizontal line to a Silverlight Toolkit column chart

安稳与你 提交于 2019-12-07 07:20:55
问题 I am using the Silverlight Toolkit in a WPF project and I would like to add a dashed red horizontal line to a column chart at a Y-axis value that I can specify. I have modified the chart template and successfully added a line, but I'm not sure how to get the line to display at the y-axis value that I want and how to get it to stretch across the entire chart. Here is a picture of the chart I have so far: and here is the chart template XAML code that I am using to generate it: <charting:Chart

How does Silverlight work? [closed]

耗尽温柔 提交于 2019-12-07 05:49:11
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . Can anyone point me to a link with detailed description on how Silverlight works. I mean in the sense that, does it run as a separate process or does it run in the same process as browser? Does the silverlight

How to get the Owner of the ContextMenu (from Silverlight 4 toolkit)?

牧云@^-^@ 提交于 2019-12-07 00:13:26
When I use ContextMenu from Silverlight 4 Toolkit I want to get ContextMenu instance's Owner, but it's not available since in ContextMenu class Owner is an internal property. For example, I have a Rectangle put inside a Border. When I right-click a Rectangle (and a context menu appears) I need to change the Rectangle Border's thickness to indicate that the Rectangle is the current element of the parent Grid, for example. So I try to use ContextMenu.Loaded event where I get the ContextMenu (through the sender parameter), but I can't get the Owner of that ContextMenu (i.e. the Rectangle with its

Showing lines with different colors on a Silverlight Toolkit’s LineChart?

余生长醉 提交于 2019-12-06 14:01:28
问题 Hy, I have a chart,wich is created in runtime,this could be Line, Bar or Pie type. Basically what i want is to have more contrast on the lines on the chart,this means i should use different colors on the lines. For Bar chart i use the StylePalette property to set wich colors will used in the chart,and it's working fine,but for Line it has no effect. As a Line chart i tried this: For the line i want to use lets say 2 colors. Style style = new Style(typeof(Control)); Setter st = new Setter

Hierarchical templating multiple object types in silverlight

蹲街弑〆低调 提交于 2019-12-06 10:15:02
Is it possible and if so what is the best way to implement the following hierarchical structure in a silverlight (4) TreeView control? (where Item and Group are classes which can exist in the tree). Group | |-Item | |-Group | | | |-Item | | | |-Item | |-Item The structure could of course be arbitrarily more complex than this, if needed. HierarchicalDataTemplates appear to be the way to approach this, but I'm specifically having trouble understanding how I might apply the template to interpret the different classes correctly. A similar question was asked for WPF, the answer for which made use

Implement search like the People search

两盒软妹~` 提交于 2019-12-06 08:33:08
问题 Is there an implementation/example of the Windows Phone native search in the People hup ? (shows a ListBox and typing in the SearchBox will filter the people in the list, and highlighting the matching texts). I was especially looking for a modification of the Windows Phone Toolkit AutocompleteBox. If nothing exists already, what would I need to do to mix the Toolkit LongListSelector with AutoCompleteBox (replacing the autocomplete popup with a filtering of a list) ? 回答1: I haven't seen

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

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