Format:
Recent snippets matching tags of silverlight
/// <summary> /// Updates the Text value for a <c>TextBox</c> each time a character changes rather than when the Control loses its Focus /// </summary> public class UpdateTextPropertyChangedBehavior : Behavior<TextBox> { /// <summary> /// Called when the behavior is attached. /// </summary> protected override void OnAttached() {
186 Views
no comments
// // Besides some IoC container hookup and the plumbing for // EventAggregator and Azure ServiceBus this is what an // Event Driven Architecture application suited for // Continuous Client may look like. // // This was not done in an MVVM pattern as it would just // introduce complexity for people unfamiliar. I wanted to // focus on the Event Driven Architecture. //
801 Views
no comments
public class Popper { public static void PopItem(UIElement control) { DoItem(TimeSpan.FromMilliseconds(200), 1, 1.5, control); } public static void UnPopItem(UIElement control) { DoItem(TimeSpan.FromMilliseconds(200), 1.5, 1, control);
294 Views
no comments
<Rectangle Width="100" Height="100" Fill="RoyalBlue" Margin="20"> <Rectangle.RenderTransform> <TransformGroup> <ScaleTransform CenterX="50" CenterY="50" ScaleX="1.5" ScaleY="1.5" /> <RotateTransform CenterX="50" CenterY="50" Angle="5" /> </TransformGroup> </Rectangle.RenderTransform> </Rectangle>
258 Views
no comments
using System; using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Animation; public class Flipper { public enum Directions { LeftToRight, RightToLeft }
679 Views
1 comments
public interface IParent { IEnumerable GetChildren(); } public interface IParent<out T> : IParent { new IEnumerable<T> GetChildren(); }
360 Views
2 comments
using System; using System.Collections; using System.Collections.Generic; namespace Core { /// <summary> /// Validation Routines /// </summary> /// <remarks>
444 Views
no comments
using System.Collections.Generic; using System.Windows.Media; namespace Sketchables { /// <summary> /// Provides a dictionary of named colors. /// </summary> public static class WellKnownColors {
448 Views
no comments
<Rectangle x:Name="myRect2" Width="20" Height="20" > <Rectangle.Fill> <ImageBrush ImageSource="Images/nav_logo13.png" Stretch="None" AlignmentX="Left" AlignmentY="Top" > <ImageBrush.Transform> <CompositeTransform TranslateX="-20" TranslateY="-20"/> </ImageBrush.Transform> </ImageBrush> </Rectangle.Fill> </Rectangle>
324 Views
no comments
namespace BitSpy.Controls.Behaviors.Beahviors.Blend.Behaviors { using System; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Interactivity; using System.Security; /// <summary>
1467 Views
no comments
/// <summary> /// Holds up the test execution for the given duration without blocking the UI thread. /// </summary> void UIPause(int sec) { Storyboard PauseSB = new Storyboard() { Duration = new Duration(new TimeSpan(0, 0, sec)) }; PauseSB.Completed += (sender, e) => { TestComplete(); }; PauseSB.Begin(); }
454 Views
no comments
using System.IO; using System.Reflection; using System.Timers; using System.Windows.Forms; using EnvDTE; using Timer = System.Timers.Timer; namespace SilverlightTestRunner { public class TestRunner { private readonly DTE _applicationObject;
364 Views
no comments
Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports EnvDTE100 Imports System.Diagnostics Imports System.IO Imports System.Threading Imports System.ComponentModel
362 Views
no comments
<?xml version="1.0" encoding="utf-8" ?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>propnc</Title> <Shortcut>propnc</Shortcut> <Description>Code snippet for property and backing field with INotifyPropertyChanged support</Description> <Author>Robert Friberg</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType>
432 Views
no comments
/* DataSet myDataSet; Example If you have a common language runtime (CLR) object you would like to bind to from XAML, one way you can make the object available for binding is to define it as a resource and give it an x:Key. In the following example, you have a Person object with a string property named PersonName. The Person object is defined in the namespace called SDKSample. XAML Copy <Window
272 Views
no comments
/// <summary> /// Asynchronously executes a given function and invokes the callback action /// on the UI thread. /// </summary> public static void RunAsync<T>(this Dispatcher dispatcher, Func<T> func, Action<T> callback) { ThreadPool.QueueUserWorkItem(s => { T result = func(); dispatcher.BeginInvoke(() => callback(result));
446 Views
no comments
<Canvas> <Line X1="-50000" Y1="10" X2="500" Y2="400" Stroke="Green" /> </Canvas>
310 Views
no comments
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Windows.Data; namespace VMLocatorSample.ViewModels { public class ViewModelLocator
1023 Views
no comments
string hostingPage = Convert.ToString(HtmlPage.Document.GetProperty("referrer")); string xapUrl = Current.Host.Source.AbsoluteUri; string applicationRoot = xapUrl.Substring(0, xapUrl.LastIndexOf("ClientBin"));
244 Views
no comments
//Check for errors bool controlHassErrors = Validation.GetHasError(ProjectNameTextBox); //Update control ProjectNameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); //Set Language private void Application_Startup(object sender, StartupEventArgs e) { CultureInfo culture = new CultureInfo("nl-NL"); Thread.CurrentThread.CurrentCulture = culture;
273 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
