WPF...Cool 3D browser

Pretty cool app to pass a minute or so http://chriscavanagh.wordpress.com/


Extension Method for Wpf Window with Froms Owner

 

Extension Method

[code:c#]

internal static class InteropExtensions
{
    public static bool? ShowDialog(this System.Windows.Window win, IntPtr handle)
    {
        WindowInteropHelper helper = new WindowInteropHelper(win);
        helper.Owner = handle;
        return win.ShowDialog();
    }
}

[/code]

 

Usage

[code:c#]

var win = new WpfWindow();
win.ShowDalog(windowsFormOwnerHandle);

[/code]

Sql Server Compact Edition

I've been playing with a workflow service hosted here http://www.briankeating.net/PSService/PSService.svc
Feel free to give it a bash [August 2012, removed]) Endpoint is using basic http binding.

Tonight I whipped a Sql Server Compact Database out of another little app I have lying around so I could sit it behind the webservice persist data.

But

To my horror it doesn't work..

I get the following exception " sql compact is not intended for asp.net development"

I can imagine why I guess.. bit what a pity.. it's not allowed..

[August 2012: It is allowed, just needs a setting]

WPF Grid splitters

Addin splitters to the WPF grid couldn't be easier.

Veritcal

<GridSplitter />

Horizontal

<GridSplitter Height="3"
   ResizeDirection="Rows" Background="Transparent"
   HorizontalAlignment="Stretch"
   VerticalAlignment="Stretch" Grid.Row="1" />

WPF Routed events

Ever have a control on a window and want to be able to receive button clicks from this child control?
More than one I've done this the hard way, but now.....

 

[code:c#]

public VariablesWindow()
  {
   this.InitializeComponent();
   variables.AddHandler(Button.ClickEvent, new RoutedEventHandler(HandleChildClick));
  }
  
  private void HandleChildClick(object sender, RoutedEventArgs args)
        {
            Button senderButton = args.OriginalSource as Button;
            if (senderButton != null && senderButton.Content != null)
            {
                string buttonText = senderButton.Content as string;
                if (buttonText == "_Cancel")
                {
                    this.DialogResult = false;
                    Close();
                }
                else if (buttonText == "_OK")
                {
                    this.DialogResult = true;
                    Close();
                }
            }
        }

[/code]

Recent Tweets

Note: For Customization and Configuration, CheckOut Recent Tweets Documentation

Calendar

<<  May 2017  >>
MoTuWeThFrSaSu
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

Month List