CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of silverlight
C#
/// <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()
        {
by Dave Timmins   June 10, 2011 @ 2:47pm
186 Views
no comments
 
C#
//
// 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.
//
by Kelly Sommers   June 04, 2011 @ 5:55pm
801 Views
no comments
 
C#
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);
by Jerry Nixon   February 01, 2011 @ 4:39pm
294 Views
no comments
 
XML
<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>
by Jerry Nixon   February 01, 2011 @ 4:35pm
258 Views
no comments
 
C#
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 }
by Jerry Nixon   February 01, 2011 @ 1:23pm
679 Views
1 comments
 
C#
public interface IParent
{
    IEnumerable GetChildren();
}
 
public interface IParent<out T> : IParent    
{
    new IEnumerable<T> GetChildren();
}
by Rob Eisenberg   January 09, 2011 @ 5:29pm
360 Views
2 comments
 
C#
using System;
using System.Collections;
using System.Collections.Generic;
 
namespace Core
{
    /// <summary>
    /// Validation Routines
    /// </summary>
    /// <remarks>
by rickrat   November 24, 2010 @ 9:56pm
444 Views
no comments
 
C#
using System.Collections.Generic;
using System.Windows.Media;
 
namespace Sketchables
{
  /// <summary>
  /// Provides a dictionary of named colors.
  /// </summary>
  public static class WellKnownColors
  {
by Philipp   November 05, 2010 @ 9:20am
448 Views
no comments
 
XML
<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>
by Arjan   July 15, 2010 @ 10:35pm
324 Views
no comments
 
C#
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>
by Joe Gershgorin   June 19, 2010 @ 1:27pm
1467 Views
no comments
 
C#
/// <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
 
C#
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;
by Keith   May 31, 2010 @ 5:42pm
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
by Keith   May 31, 2010 @ 5:32pm
362 Views
no comments
 
XML
<?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>
by Robert Friberg   May 03, 2010 @ 6:30am
432 Views
no comments
 
C#
/*
 
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
by FoxyComputersLtd   April 24, 2010 @ 8:56am
272 Views
no comments
 
C#
/// <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));
by Philipp   April 20, 2010 @ 2:10pm
446 Views
no comments
 
XML
<Canvas>
    <Line X1="-50000" Y1="10" X2="500" Y2="400" Stroke="Green" />
</Canvas>
 
by Alan Mendelevich   April 06, 2010 @ 8:11am
310 Views
no comments
 
C#
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
by Bobby Diaz   March 31, 2010 @ 8:44am
1023 Views
no comments
 
C#
string hostingPage = Convert.ToString(HtmlPage.Document.GetProperty("referrer"));
string xapUrl = Current.Host.Source.AbsoluteUri;
string applicationRoot = xapUrl.Substring(0, xapUrl.LastIndexOf("ClientBin"));
by Arjan   March 24, 2010 @ 1:17pm
244 Views
no comments
 
C#
//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;
by Arjan   March 24, 2010 @ 11:38am
273 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate