Tuesday, January 21, 2014

XAML close minimize restore and maximize Geometry




·         <Geometry x:Key="closeGeometry">

        F1 M 151,217L 152,217L 154.5,219.5L 157,217L 158,217L 158,218L 155.5,220.5L 158,223L 158,224L 157,224L 154.5,221.5L 152,224L 151,224L 151,223L 153.5,220.5L 151,218L 151,217 Z

    </Geometry>

 

·         <Geometry x:Key="minimizeGeometry">

        M0,0 L8,0 8,1 8,2 0,2 0,1 z

    </Geometry>

 

·         <Geometry x:Key="maximizeGeometry">

        F1 M 34,17L 43,17L 43,23L 34,23L 34,17 Z M 35,19L 35,22L 42,22L 42,19L 35,19 Z

    </Geometry>

 

·         <Geometry x:Key="restoreGeometry">

        M1,4.9996096 L1,7.000219 7,6.999219 7,5.001 2,5.001 2,4.9996096 z M3,2.0014141 L3,3.0000001 8,3.0000001 8,4.0000001 8,4.0008045 9,4.0008045 9,2.0014141 z M2,0 L10,0 10,0.0010234118 10,1.0000001 10,5.001 8,5.001 8,7.9990235 0,8.0000239 0,4.0000001 0,3.0009998 0,3.0000001 2,3.0000001 2,1.0000001 2,0.0010234118 z

    </Geometry>

Visual studio 2010 with Beyond compare Merge and Diff




Tools->Options->Source Control->Visual Studio Team Foundation Server.

Press Configure User Tools

Add Compare and Merge operations

In The command search for the Beyond compare exe

in the arguments insert

  1. For Compare -> %1 %2 /title=%6 /title2=%7
  2. For merge %1 %2 /savetarget=%4 /title1=%6 /title2=%7

Sunday, May 29, 2011

WCF Service failing with “The server has rejected the client credentials”.

Great article regarding an issue that happens a lot

Tuesday, April 12, 2011

Step By Step Creating WPF User Control

1.       Create WPF User control library. It will create such class
partial class MySuperTextBox : UserControl
2.       Create DependencyProperty via propdp

  public int MyProperty
        {
            get { return (int)GetValue(MyPropertyProperty); }
            set { SetValue(MyPropertyProperty, value); }
        }

        // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty MyPropertyProperty =
            DependencyProperty.Register("MyProperty", typeof(int), typeof(ownerclass), new UIPropertyMetadata(0));

   

3.       No you can change the dp to the type you need

  public string Text
        {
            get { return (string)GetValue(TextProperty); }
            set { SetValue(TextProperty, value); }
        }


        // Using a DependencyProperty as the backing store for Text.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TextProperty =
            DependencyProperty.Register("Text", typeof(string), typeof(MySuperTextBox), new FrameworkPropertyMetadata("red", new PropertyChangedCallback(qwe)));

4.       The difference between UIPropertyMetadata to FrameworkPropertyMetadata is that UIPropertyMetadata does only initialize the dp , FrameworkPropertyMetadata can also fire events.

5.  new FrameworkPropertyMetadata("red", new PropertyChangedCallback(qwe)));
qwe is a function with this signature (need to do that manually).

private static void qwe(DependencyObject obj,DependencyPropertyChangedEventArgs args)
        {
            MySuperTextBox mstb = obj as MySuperTextBox;
            mstb.txt.Text = args.NewValue.ToString();
        }

6.       That closed the User Control.
7.       If you want to use this control in a WPF application.
8.       Create WPF application
9.       You can see the user control in the toolbox


10.   Drag it to your XAML
11.   This will
a.       Add reference
b.      Add xmlns : xmlns:my="clr-namespace:MyControl;assembly=MyControl">
c.       Add the control to the XAML <my:MySuperTextBox Name="mySuperTextBox2" />
d.      You can bind the dp in the user control to other data (textBox1 is a TextBox Control):

<my:MySuperTextBox Name="mySuperTextBox1" Text="{Binding ElementName=textBox1, Path=Text}" />

12. That’s it.

 
Home | About | Link | Link
Simple Proff Blogger Template Created By Herro | Inspiring By Busy Bee Woo Themes