silverlight

PivotControl item changing behavior in Silverlight Windows Phone 7

℡╲_俬逩灬. 提交于 2020-01-03 02:32:27
问题 I have an app where the user is sent to a page with a PivotControl . The SelectedIndex is not known until the user navigates to the page. I'm setting the SelectedIndex , but it causes the PivotControl to start on index 0, then flip through to the index I set. This is kind of annoying, and I'd rather just have it go directly to the index I set. Is there some way around this? One hack I thought up was providing the data to pivotControl.ItemsSource in an order such that the item I want the user

Reading XML data using LINQ, multiple elements with the same name

自作多情 提交于 2020-01-03 02:29:29
问题 Visual Studio 2010, Silverlight 4, and C#. I have the following data stored in an XML file: <root> <element>TextHere</element> <element>TextHere</element> <element>TextHere</element> </root> This is my current code. XDocument xmlDoc = XDocument.Load("XMLDocument.xml"); var ElementsList = from Elements in xmlDoc.Descendants("root") select new { ElementContent = Elements.Element("Element").Value, }; This code only puts the very first element in the list, leaving all of the others out. How can I

Prevent DataGridDragDropTarget from Showing “Drag Shadow”

我的梦境 提交于 2020-01-03 02:26:08
问题 Is it possible to prevent the Silverlight Toolkit DataGridDragDropTarget from starting a drag-action? What I whant is to use one DataGrid only as DragSource and another one only as DropTarget. And the DropTarget-only-DataGrid should not show this "StartDragShadow" when pressing and moving the mouse over an item. 回答1: Just set the AllowedSourceEffects attribute of the toolkit:DataGridDragDropTarget control to "None" : <toolkit:DataGridDragDropTarget AllowDrop="true" AllowedSourceEffects="None"

WP7 - Cancelling ContextMenu click event propagation

冷暖自知 提交于 2020-01-03 01:52:11
问题 I'm having a problem when the Silverlight toolkit's ContextMenu is clicked while it is over a UIElement that has registered a Tap event GestureListener . The context menu click propagates to the underlying element and fires its tap event. For instance, say I have a ListBox and each ListBoxItem within it has registered both a ContextMenu and a Tap GestureListener . Assume that clicking context menu item2 is supposed to take you to Page1.xaml, while tapping on any of ListBox items themselves is

Scrollable form control in Windows Phone 8

廉价感情. 提交于 2020-01-03 00:52:26
问题 How do I make a scrollable form similar to that of the Phone Contact input panel in Windows Phone 8.1? The current method of StackPanel inside a ScrollViewer restricts scrolling when the SIP launches and I have to hit back button to choose other TextBoxes. This is not an idea UX situation and I've tried a few options of the web. Increasing the StackPanel's height beyond its necessary size by about 350 pixels - didn't work, as it displaces the form unevenly and doesn't return to normal

Silverlight Canvas on Scrollviewer not triggering

笑着哭i 提交于 2020-01-03 00:21:06
问题 Why does this work so well in wpf <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <Canvas x:Name="MyDesigner"> </Canvas> </ScrollViewer> Now when I do the same thing in silverlight and load an control "that can be dragged" the scrollbars are not triggered, when I drag out of view, nothing happens... but in wpf it automatically shows them... 回答1: Here is the solution I found. The canvas can grow dynamically, but you will need to explicitly set the height

Silveright ScrollViewer with Image and ScaleTransform

对着背影说爱祢 提交于 2020-01-02 20:43:06
问题 I have the following xaml. <ScrollViewer HorizontalAlignment="Stretch" Margin="107,0,0,0" Name="scrollViewer1" VerticalAlignment="Stretch" HorizontalScrollBarVisibility="Visible"> <Image Name="image1" Stretch="None" MouseWheel="image1_MouseWheel" RenderTransformOrigin="0,0"> </Image> </ScrollViewer> An the following code behind. // initialise. private TransformGroup group = new TransformGroup(); private ScaleTransform st = new ScaleTransform(); group.Children.Add(st); image1.RenderTransform =

IsolatedStorageSettings throws an IsolatedStorageFileStream when I try to get value

瘦欲@ 提交于 2020-01-02 19:45:45
问题 I'm trying to get a boolean value I saved using isolatedStoragesettings like this: IsolatedStorageSettings.ApplicationSettings.TryGetValue(KEYSTRING, out myBoolValue); but I get this exception only when I debug Operation not permitted on IsolatedStorageFileStream. when I use (run without debug) Ctrl+F5 it works just fine. any idea whats wrong here? 回答1: It appears that this exception can be the result of accessing IsolatedStorageSettings.ApplicationSettings from multiple threads (which would

WPF Custom Control's ToolTip MultiBinding problem

五迷三道 提交于 2020-01-02 17:52:58
问题 When I set a ToolTip Binding In a WPF Custom Control, this way it works perfect: public override void OnApplyTemplate() { base.OnApplyTemplate(); ... SetBinding(ToolTipProperty, new Binding { Source = this, Path = new PropertyPath("Property1"), StringFormat = "ValueOfProp1: {0}" }); } But when I try to use MultiBinding to have several properties in the ToolTip, it doesn't work: public override void OnApplyTemplate() { base.OnApplyTemplate(); ... MultiBinding multiBinding = new MultiBinding();

WPF Custom Control's ToolTip MultiBinding problem

谁都会走 提交于 2020-01-02 17:51:32
问题 When I set a ToolTip Binding In a WPF Custom Control, this way it works perfect: public override void OnApplyTemplate() { base.OnApplyTemplate(); ... SetBinding(ToolTipProperty, new Binding { Source = this, Path = new PropertyPath("Property1"), StringFormat = "ValueOfProp1: {0}" }); } But when I try to use MultiBinding to have several properties in the ToolTip, it doesn't work: public override void OnApplyTemplate() { base.OnApplyTemplate(); ... MultiBinding multiBinding = new MultiBinding();