silverlight-3.0

MVVM - RaisePropertyChanged turning code into a mess

╄→гoц情女王★ 提交于 2019-12-01 03:34:33
New to MVVM so please excuse my ignorance. I THINK i'm using it right but I find my ViewModel has too many of these: RaisePropertyChanged("SomeProperty") Every time I set a property I have to raise that damned property changed. I miss the days where I could just go: public int SomeInteger { get; private set;} These days I have to stick the "RaisePropertyChanged" in everywhere or my UI does not reflect the changes :( Am I doing it wrong or are other people getting annoyed with the excessive number of magic strings and old school property setters? Should I be using dependency properties instead?

How to go back to “Base” state using VisualStateManager?

别说谁变了你拦得住时间么 提交于 2019-12-01 02:29:20
I know we can use VisualStateManager.GoToState(this,"SomeState1",true); to enter into SomeState1 , but now how to go back to the base state, like no state, the state where the control was loaded in. VisualStateManager.GoToState(this,"base",true); // OR VisualStateManager.GoToState(this,"",true); // OR VisualStateManager.GoToState(this,null,true); The problem is if there is no such way to go back to the initial or base state then I will have to always create a first state and in the contructor goto the first state in the start of control. I didnt find any documentation, so I am trying all

Silverlight and ArrayList

只愿长相守 提交于 2019-12-01 01:55:09
问题 Does Visual Studio 2010's Silverlight support ArrayList? If yes then how to use it, if not then why? How to use ArrayList in Silverlight? 回答1: Silverlight don't support ArrayList now, see http://www.infoq.com/news/2007/07/ArrayList-Gone. EDIT: Here is the content from this link, an effort to reduce the size of the Silverlight runtime, most of the non-generic collection types will be removed. These include types once considered essential to .NET programming including ArrayList, Hashtable, and

How to replace link to hyperlink in RichTextBox (Windows phone)

女生的网名这么多〃 提交于 2019-12-01 01:18:03
I have a text: Download it directly to the <a href="http://itunes.apple.com/fi/app/goalapp/id502461189?ls=1&mt=8">iTunes Store</a> or <a href="https://market.android.com/details?id=com.strikersoft.meramal.se">Android Market</a>. The application is launched for Swedish app store. I know how to show a hyperlink in RichTextBox: http://msdn.microsoft.com/en-us/library/ee681613%28v=vs.95%29.aspx But how can I make this for everyone link in this code? Filip Skakun You should parse the string maybe with something like RegEx or using a library like html agility pack . This extension method should work

MVVM - RaisePropertyChanged turning code into a mess

空扰寡人 提交于 2019-11-30 23:56:08
问题 New to MVVM so please excuse my ignorance. I THINK i'm using it right but I find my ViewModel has too many of these: RaisePropertyChanged("SomeProperty") Every time I set a property I have to raise that damned property changed. I miss the days where I could just go: public int SomeInteger { get; private set;} These days I have to stick the "RaisePropertyChanged" in everywhere or my UI does not reflect the changes :( Am I doing it wrong or are other people getting annoyed with the excessive

Cleanest single click + double click handling in Silverlight?

痴心易碎 提交于 2019-11-30 15:35:40
问题 I've been finding various methods of dealing with double click and then the authors slap on some if code for handling single clicks. Is there a standard now in Silverlight 3 that everyone is using to handle both a single and a double click on listboxes? 回答1: If you use the Reactive Extensions (Rx) library the code to support double click is much simpler: Observable.FromEvent<MouseButtonEventArgs>(myControl, "MouseLeftButtonDown").TimeInterval().Subscribe(evt => { if (evt.Interval

Cleanest single click + double click handling in Silverlight?

a 夏天 提交于 2019-11-30 14:59:45
I've been finding various methods of dealing with double click and then the authors slap on some if code for handling single clicks. Is there a standard now in Silverlight 3 that everyone is using to handle both a single and a double click on listboxes? If you use the Reactive Extensions (Rx) library the code to support double click is much simpler: Observable.FromEvent<MouseButtonEventArgs>(myControl, "MouseLeftButtonDown").TimeInterval().Subscribe(evt => { if (evt.Interval.TotalMilliseconds <= 300) { // Do something on double click } }); Write once use easily.... import YourProject.Utils; /

Is there a click behavior for a list?

…衆ロ難τιáo~ 提交于 2019-11-30 14:22:12
问题 I have a list view, on a panoramic control. I've also created an event for MouseLeftButtonUp however I find that when scrolling between the panorama items the MousLeftButtonUp is triggering (it makes sense why but it is unexpected from a user perspective). Is there any way to create a click event for a list? Or add a behavior that simulates that? 回答1: Checkout the Tap gesture from the Gesture service that's part of the toolkit. WP7 Tip of the Day: Silverlight Toolkit: Gestures <ListBox Height

C# Silverlight 3 - Programmatically Navigate Between Pages?

ⅰ亾dé卋堺 提交于 2019-11-30 13:42:24
Say I have a C# Silverlight 3 application with a number of pages. The first page is called Home, and the second page is called Details. The only way to navigate to details is programmatically. How do I do this?! Looked everywhere for the answer and all i've found are xaml uri mapper implementations.... Help greatly appreciated Have you tried the NavigationService? this.NavigationService.Navigate(new Uri("Details.xaml", UriKind.Relative)); c#: this.navContent.Navigate(new Uri("Welcome", UriKind.Relative)); XAML: <navigation:Frame x:Name="navContent" HorizontalContentAlignment="Stretch"

Is there a click behavior for a list?

倖福魔咒の 提交于 2019-11-30 10:06:20
I have a list view, on a panoramic control. I've also created an event for MouseLeftButtonUp however I find that when scrolling between the panorama items the MousLeftButtonUp is triggering (it makes sense why but it is unexpected from a user perspective). Is there any way to create a click event for a list? Or add a behavior that simulates that? Checkout the Tap gesture from the Gesture service that's part of the toolkit. WP7 Tip of the Day: Silverlight Toolkit: Gestures <ListBox Height="100" HorizontalAlignment="Left" Margin="12,186,0,0" Name="listBox1" VerticalAlignment="Top" Width="460" >