Author Topic: Exception Class  (Read 4606 times)

0 Members and 1 Guest are viewing this topic.

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Exception Class
« Reply #15 on: October 15, 2015, 02:16:19 PM »
This is the most basic example I can create explaining my previous post.

In your XAML:
Code: [Select]
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Width="75" Content="Cancel" Margin="5" IsCancel="True"/>
            <Button Width="75" Content="OK" Margin="5" IsDefault="True" Click="OkClicked"/>
</StackPanel>

In your code behind:
Code - C#: [Select]
  1. private void OkClicked(object sender, RoutedEventArgs e)
  2. {
  3.     DialogResult = true;
  4. }

Code - C#: [Select]
  1. var window = new myWindow();
  2. var result = window.ShowDialog();
  3. if (!result) //Return if they clicked Cancel or Closed the window
  4.     return;
  5.  
  6. //Do something if they clicked OK
  7.  
« Last Edit: October 15, 2015, 02:19:58 PM by MexicanCustard »
Revit 2019, AMEP 2019 64bit Win 10

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: Exception Class
« Reply #16 on: October 15, 2015, 02:27:08 PM »
every time you do that Zod kills a little kitten.


Made me laugh.  ;D ;D
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Exception Class
« Reply #17 on: October 15, 2015, 10:08:26 PM »
every time you do that Zod kills a little kitten.


Made me laugh.  ;D ;D

Yep, Me too :)

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

shers

  • Guest
Re: Exception Class
« Reply #18 on: October 18, 2015, 11:50:59 PM »
Thanks all! It's solved. I had to handle it in the main.