From 767935293441129190658e5de266f23d002e3773 Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Thu, 5 Aug 2010 16:44:34 +0000 Subject: [PATCH] Initial check in of new MessageBox control --- .../BusyIndicator/BusyIndicator.cs | 1 - .../MessageBox/Icons/Error48.png | Bin 0 -> 4170 bytes .../MessageBox/Icons/Information48.png | Bin 0 -> 5101 bytes .../MessageBox/Icons/Question48.png | Bin 0 -> 5492 bytes .../MessageBox/Icons/Warning48.png | Bin 0 -> 3281 bytes .../MessageBox/MessageBox.cs | 396 ++++++++++++++++++ .../MessageBox/MessageBox.xaml | 300 +++++++++++++ .../MessageBox/VisualStates.MessageBox.cs | 17 + .../Properties/AssemblyInfo.cs | 4 +- .../WPFToolkit.Extended/Themes/Generic.xaml | 299 ++++++++++++- .../WPFToolkit.Extended.csproj | 12 + 11 files changed, 1024 insertions(+), 5 deletions(-) create mode 100644 ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Icons/Error48.png create mode 100644 ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Icons/Information48.png create mode 100644 ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Icons/Question48.png create mode 100644 ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Icons/Warning48.png create mode 100644 ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.cs create mode 100644 ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.xaml create mode 100644 ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/VisualStates.MessageBox.cs diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/BusyIndicator/BusyIndicator.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/BusyIndicator/BusyIndicator.cs index d7f5f116..6a73cd8f 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/BusyIndicator/BusyIndicator.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/BusyIndicator/BusyIndicator.cs @@ -9,7 +9,6 @@ namespace Microsoft.Windows.Controls /// /// A control to provide a visual indicator when an application is busy. /// - /// Preview [TemplateVisualState(Name = VisualStates.StateIdle, GroupName = VisualStates.GroupBusyStatus)] [TemplateVisualState(Name = VisualStates.StateBusy, GroupName = VisualStates.GroupBusyStatus)] [TemplateVisualState(Name = VisualStates.StateVisible, GroupName = VisualStates.GroupVisibility)] diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Icons/Error48.png b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Icons/Error48.png new file mode 100644 index 0000000000000000000000000000000000000000..4304d43b5fb9ed5285608ab9a278e0eb8261b2ef GIT binary patch literal 4170 zcmV-Q5Vh}#P)pU{7FPXRA@uxS!Z}uWfpduTin%kSKSpvK}8TdHdLypU>A@gtRVKT zfCUf~U677|k0??COHipH^p*(*B0>U5NH35~CS{ULxl=Nekn-+(zT7*{%`l0<-Tk#Z z&v|At_ulV2?>X;z&-pIrob&(o55O;4v0w69Tdc)3{%7%Q!RbiO{)+duW|5vb1JHjB zNCd~j9WXolYu?`$Gd~l)UNbQN5s)zF%^O8>`Zv5k+|K21Vv(*HKwAP60`jv!wBWq4 znX$RynBnNTjg5`JZOwE*;lRSd7{U7aAWQ&^#mvq(b6gze{l63A_usc>ru*cXNI;Bz znt?d0EVSUfIqGU-!*Ro5{`Lp4W5x zsniN}Bq|~2!yV_}7tsEkot@p0bg|~==Od7jfz0mRkpsLO`^QN)e(jsSG)uXtU3bVjL7SeQ&HEQxhN?qsk_j` z>2$(2aUyc=zn_Ww!-Z?FwBWek#X8U#ozWEluPd`;w{q-_5 zl1h0mzl{8M-$PYZl`81O#KZvx2vcDTO~bR$j7DeFfeC<;PMv?E%jW0{?=PWUO1q2^ zJS>GP#hKBg2WqTV)E5*WxH$&Fjhhf$zX85a{z>};zK=ga&G!iiWM(1x?t9=oas(VN z1jJ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/Information48.png new file mode 100644 index 0000000000000000000000000000000000000000..3507518716c6898b5526a9619a5e2605b8bb27f3 GIT binary patch literal 5101 zcmZ8lWmpqz+ol@?C(yzhr-{*Lb@5gmt|L!`^^SaLaj(wsBWu)VzBOxJSe59rM^iKv|1r61o(Uj~s z`cI;TYngeIkTA7h1!&eYQ#odMC#t|84}=Yx zIc941J{a@eLjG9F6$@#dAuMz?O!?0sD`vd=RQjqhn35gs+H(^2Nu?9zgX3(ush2xV zvD~tW>=JFeY%$GBH=mAobvX-Vjm^yPv9PdcX=y$1^OL2cr#CP#AjF$kTDtdG)xk;m z`T6Aob_E)nntGwhyg7HQ{fj%SN(;W62O*JimBw8-+$||7z8r|-W{1oZ4#hbCu zs0#>K4dy6?oQ5$c?wD6O&Nr0RhnV%ocYl<0j^pugZUwKR6Z~8|m$I_*$yDUykYL)T zrgSP;kCW7Hd>l)vbpmU#*nBUF6wxQa&i75z7MH;uRJ%Zi9Zid=I1rq2KN+rD1`D6m z1h2((--Fn_pq-zeZ*hUS;0Dzy2J(v1M<`MK{ZH;%hqd6yg1)sz@Qa4yw@*MptDMpL z{(^Hq$=BEy0yq|um+f}D)pb;iBR;8iKq@>F-K>2IMik2~?cD^z4Cxp(eq}3=bJ|_} zEO_`aA$7#?>C==<)2JPP;aSv@Gd@a#eR@VGdHYd2`uW(=HjKrI(x^pnTT%Hb7hJKJ zmejR=_`=8pcpxz106vn@*}X5dTBEno0X_RrCkQO5B#Wy=qtQ$K`5F!vMadyqIzOl> zC~hfLknpBbB7Du5t<5+R`r+yj!;Lo_(aH?+}|T2T`lB7`HMHb zZOA=9UyoWM+B9meERpuec0@3NDAFkqLSHK=JC87-|Fwv@U0ugmf& z^*P17P%UF1LI4~N!M*-vM0T`-X;ms=6Tbn?x#xJDJK_%(~OAmqqlq?-K=8#pS z8Bu=QRu6nNxF!J`v+U;K^x4Tkt5Mcj9a6Y5wS4**)k?(8pe+k$Jes>ZZPHkEEW(g~ za&q$C%fs#S=AWCN42yf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ol>m(*K!d)nz}*7Ey`4RK{{LDkH#0bM zF>f>Mjf2%GRDE>R1HkWP#eaVD-5>%?R@AUTV;cmKwB#pE!nsSoxMQ{#+8EBdX)GFC z+hbJSEC>{7o9}suyc(AZ0QmJj5IwAK#yTq=m?|iL!+P{zssD3{<6@uqm&G~oTdH@W zo+PQ~J+l+JiwS+1(Rev=%|fncU@zyn%k%t56A=PpKo{Z?ox!4A{l= zP1zmULvfZAE1w2^#b4qDmoK1rsdJo@*(oEgIN+8u9G`p?ThY6@nf1n$_p>{1vRGK~ zuY%o>vuY9Gk;`v1t;fLWS0v#*XOuwiQFc+_XTh2|-Q z7E9Ee+kuS~6Maj*SGE1W{64f%BUE;NO}cKPTdeo8;@$$9>$!RJwH%x9*q!9Ux4%1+ z84M5Lo^>p=R)|$puD5t$-);$e3vgSCi<3atx6yupnJWQqA&|bR*qK!NL;Sp+N0sR- ziT~`rPec1LT&*I0KBRr`D^t-!g-4U&b$m!@^Dutjty)YeaNK&Ux2CoCalT#uoP z+gEj#&0x_olKo&xthU@xq^+C^Og@ zUj1eS_ZMg~yx~a_HSL?FC)BaB#F@@(oag- z{<cbO=l#NJy(pQQeH!f_?c1T!2@~9rEKCDO zUFi>qd7Lq%?(0y+PTMdy=>y6Sz;%04PR^`%)Q&tot6Q$JE0=5)m$|J$Jlj9C_Zc$e zrP8L3j-h?XZ|f*Dx)6(gbYm>>ggpBLV(1fPt!h#0-d5RXFtU^=f&38p?%4y zsGy$DRq2qoqbqA25B4okn!RIV3dy~=Ma#|$hgu7@CzGFACRQ)m(xz6tU_f`^pZ`0O NM_@h8a&_CV{{x~L{;>c6 literal 0 HcmV?d00001 diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Icons/Question48.png b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Icons/Question48.png new file mode 100644 index 0000000000000000000000000000000000000000..dad7dd09af4316e01b95d656b50d943f0f4ffe8d GIT binary patch literal 5492 zcmV-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H%%_;=qcvW}UR#D+yFHM$%fs=p2b^eBI?|n?DV4F%n#|@Sn~UjS ztXq%1Qr`De1i*NA0r4UUy-0Gr3lhIo2EtH27lyLg95(}(j*P>$)z4zfs$U`ch@CV} z%rjLlq!Bcz=4Bf43JrPnTd=fl;GTJG{?DUPA%i;K6;+pHNZaZD=*Gv^sMzxk#~JEu zZ-x+sMe^pJbZBq8^+QG-dq9`x30=N7^aVc97fy!0$Paxb{vW&VpGlN?t8=#R1Uf%52CZ`Ftdz$NruroWi8nBm8W~CtL(6;II~yi#3=Noswlo(g zlU$IzLtdM>X%In+Mx{N@i48i1n?4Em>P24G!qgTjk+wk&Ey-&ONxq2UF7|_tUf0v> z`m!0&S1^1k=VJ4!Um}N|kNE64oZbE##2t5{ke`9EVJVD_%P1#mqiF^4#v@_rIYtf{ zjEGJ51)X=w6A9ZrAFPw4Mnz#y#ZTq|!dfI}p+w$lR?*8-N!-&0hK!b8*U{@bdR@ob zNY8lJm(L>kxzJMweT;R*5eIzo_OB6p)Dd4Du*b&bzd-l_N0MI-qf(G&HfnzJ@o42+ zuq2U78d_qfLzV1>w%o}`*yahog|BZinj`HKJ5oGZ@62LdK8eE32t=ac*F^7?t!oL&ey<3dREI`sH6A`yb?lXqoSE#dRFykylTgoI}g=cUuuLsdhh?`}ez)%w%L>r+Z z#N}->A)1;-qJgL)zy@U{t3ZFom=8+^L2e}Es|O)pHVFCrLCA~H z9h|%{#A1w1aWDSPMFMId2Gb)3LAZJvt zt13U`g0e4M*mU!*=fngQe?9?4$6Zl)%vE$x$UowSyu)tDJ>5xMaFOSlEULr5ai=N^?T|+u%I|fx$!J+ P00000NkvXXu0mjf8D~qm literal 0 HcmV?d00001 diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.cs new file mode 100644 index 00000000..fe9a00bb --- /dev/null +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.cs @@ -0,0 +1,396 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Controls.Primitives; + +namespace Microsoft.Windows.Controls +{ + [TemplateVisualState(Name = VisualStates.OK, GroupName = VisualStates.MessageBoxButtonsGroup)] + [TemplateVisualState(Name = VisualStates.OKCancel, GroupName = VisualStates.MessageBoxButtonsGroup)] + [TemplateVisualState(Name = VisualStates.YesNo, GroupName = VisualStates.MessageBoxButtonsGroup)] + [TemplateVisualState(Name = VisualStates.YesNoCancel, GroupName = VisualStates.MessageBoxButtonsGroup)] + public class MessageBox : Control + { + #region Private Members + + /// + /// Tracks the MessageBoxButon value passed into the InitializeContainer method + /// + private MessageBoxButton _button = MessageBoxButton.OK; + + #endregion //Private Members + + #region Constructors + + static MessageBox() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(MessageBox), new FrameworkPropertyMetadata(typeof(MessageBox))); + } + + internal MessageBox() + { /*user cannot create instance */ } + + #endregion //Constructors + + #region Properties + + #region Protected Properties + + /// + /// A System.Windows.MessageBoxResult value that specifies which message box button was clicked by the user. + /// + protected MessageBoxResult MessageBoxResult = MessageBoxResult.None; + + protected Window Container { get; private set; } + protected Thumb DragWidget { get; private set; } + protected Button CloseButton { get; private set; } + + protected Button OkButton { get; private set; } + protected Button CancelButton { get; private set; } + protected Button YesButton { get; private set; } + protected Button NoButton { get; private set; } + + protected Button OkButton1 { get; private set; } + protected Button CancelButton1 { get; private set; } + protected Button YesButton1 { get; private set; } + protected Button NoButton1 { get; private set; } + + #endregion //Protected Properties + + #region Dependency Properties + + public static readonly DependencyProperty CaptionProperty = DependencyProperty.Register("Caption", typeof(string), typeof(MessageBox), new UIPropertyMetadata(String.Empty)); + /// + /// Gets or sets the caption. + /// + /// The caption. + public string Caption + { + get { return (string)GetValue(CaptionProperty); } + set { SetValue(CaptionProperty, value); } + } + + public static readonly DependencyProperty ImageSourceProperty = DependencyProperty.Register("ImageSource", typeof(ImageSource), typeof(MessageBox), new UIPropertyMetadata(default(ImageSource))); + /// + /// Gets or sets the message image source. + /// + /// The message image source. + public ImageSource ImageSource + { + get { return (ImageSource)GetValue(ImageSourceProperty); } + set { SetValue(ImageSourceProperty, value); } + } + + public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(MessageBox), new UIPropertyMetadata(String.Empty)); + /// + /// Gets or sets the message text. + /// + /// The message text. + public string Text + { + get { return (string)GetValue(TextProperty); } + set { SetValue(TextProperty, value); } + } + + #endregion //Dependency Properties + + #endregion //Properties + + #region Base Class Overrides + + /// + /// Overrides the OnApplyTemplate method. + /// + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + DragWidget = (Thumb)GetTemplateChild("PART_DragWidget"); + if (DragWidget != null) + DragWidget.DragDelta += (o, e) => ProcessMove(e); + + CloseButton = (Button)GetTemplateChild("PART_CloseButton"); + if (CloseButton != null) + CloseButton.Click += (o, e) => Close(); + + NoButton = (Button)GetTemplateChild("PART_NoButton"); + if (NoButton != null) + NoButton.Click += (o, e) => Button_Click(o, e); + + NoButton1 = (Button)GetTemplateChild("PART_NoButton1"); + if (NoButton1 != null) + NoButton1.Click += (o, e) => Button_Click(o, e); + + YesButton = (Button)GetTemplateChild("PART_YesButton"); + if (YesButton != null) + YesButton.Click += (o, e) => Button_Click(o, e); + + YesButton1 = (Button)GetTemplateChild("PART_YesButton1"); + if (YesButton1 != null) + YesButton1.Click += (o, e) => Button_Click(o, e); + + CancelButton = (Button)GetTemplateChild("PART_CancelButton"); + if (CancelButton != null) + CancelButton.Click += (o, e) => Button_Click(o, e); + + CancelButton1 = (Button)GetTemplateChild("PART_CancelButton1"); + if (CancelButton1 != null) + CancelButton1.Click += (o, e) => Button_Click(o, e); + + OkButton = (Button)GetTemplateChild("PART_OkButton"); + if (OkButton != null) + OkButton.Click += (o, e) => Button_Click(o, e); + + OkButton1 = (Button)GetTemplateChild("PART_OkButton1"); + if (OkButton1 != null) + OkButton1.Click += (o, e) => Button_Click(o, e); + + ChangeVisualState(_button.ToString(), true); + } + + #endregion //Base Class Overrides + + #region Methods + + #region Public Static + + /// + /// Displays a message box that has a message and that returns a result. + /// + /// A System.String that specifies the text to display. + /// A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user. + public static MessageBoxResult Show(string messageText) + { + return Show(messageText, string.Empty, MessageBoxButton.OK); + } + + /// + /// Displays a message box that has a message and title bar caption; and that returns a result. + /// + /// A System.String that specifies the text to display. + /// A System.String that specifies the title bar caption to display. + /// A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user. + public static MessageBoxResult Show(string messageText, string caption) + { + return Show(messageText, caption, MessageBoxButton.OK); + } + + /// + /// Displays a message box that has a message and that returns a result. + /// + /// A System.String that specifies the text to display. + /// A System.String that specifies the title bar caption to display. + /// A System.Windows.MessageBoxButton value that specifies which button or buttons to display. + /// A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user. + public static MessageBoxResult Show(string messageText, string caption, MessageBoxButton button) + { + return ShowCore(messageText, caption, button, MessageBoxImage.None); + } + + /// + /// Displays a message box that has a message and that returns a result. + /// + /// A System.String that specifies the text to display. + /// A System.String that specifies the title bar caption to display. + /// A System.Windows.MessageBoxButton value that specifies which button or buttons to display. + /// A System.Windows.MessageBoxImage value that specifies the icon to display. + /// A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user. + public static MessageBoxResult Show(string messageText, string caption, MessageBoxButton button, MessageBoxImage icon) + { + return ShowCore(messageText, caption, button, icon); + } + + #endregion //Public Static + + #region Private Static + + private static MessageBoxResult ShowCore(string messageText, string caption, MessageBoxButton button, MessageBoxImage icon) + { + MessageBox msgBox = new MessageBox(); + msgBox.InitializeMessageBox(messageText, caption, button, icon); + msgBox.Show(); + return msgBox.MessageBoxResult; + } + + /// + /// Resolves the owner Window of the MessageBox. + /// + /// + private static FrameworkElement ResolveOwner() + { + FrameworkElement owner = null; + if (Application.Current != null) + { + foreach (Window w in Application.Current.Windows) + { + if (w.IsActive) + { + owner = w; + break; + } + } + } + return owner; + } + + #endregion //Private Static + + #region Protected + + /// + /// Shows the MessageBox + /// + protected void Show() + { + Container.ShowDialog(); + } + + /// + /// Initializes the MessageBox. + /// + /// The text. + /// The caption. + /// The button. + /// The image. + protected void InitializeMessageBox(string text, string caption, MessageBoxButton button, MessageBoxImage image) + { + Text = text; + Caption = caption; + _button = button; + SetImageSource(image); + Container = CreateContainer(); + } + + /// + /// Changes the control's visual state(s). + /// + /// name of the state + /// True if state transitions should be used. + protected void ChangeVisualState(string name, bool useTransitions) + { + VisualStateManager.GoToState(this, name, useTransitions); + } + + #endregion //Protected + + #region Private + + /// + /// Sets the message image source. + /// + /// The image to show. + private void SetImageSource(MessageBoxImage image) + { + String iconName = String.Empty; + + switch (image) + { + case MessageBoxImage.Error: + { + iconName = "Error48.png"; + break; + } + case MessageBoxImage.Information: + { + iconName = "Information48.png"; + break; + } + case MessageBoxImage.Question: + { + iconName = "Question48.png"; + break; + } + case MessageBoxImage.Warning: + { + iconName = "Warning48.png"; + break; + } + case MessageBoxImage.None: + default: + { + return; + } + } + + ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString(String.Format("pack://application:,,,/WPFToolkit.Extended;component/MessageBox/Icons/{0}", iconName)); + } + + /// + /// Creates the container which will host the MessageBox control. + /// + /// + private Window CreateContainer() + { + return new Window() + { + AllowsTransparency = true, + Background = Brushes.Transparent, + Content = this, + Owner = Window.GetWindow(ResolveOwner()), + ShowInTaskbar = false, + SizeToContent = System.Windows.SizeToContent.WidthAndHeight, + ResizeMode = System.Windows.ResizeMode.NoResize, + WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner, + WindowStyle = System.Windows.WindowStyle.None + }; + } + + #endregion //Private + + #endregion //Methods + + #region Event Handlers + + /// + /// Processes the move of a drag operation on the header. + /// + /// The instance containing the event data. + private void ProcessMove(DragDeltaEventArgs e) + { + Container.Left = Container.Left + e.HorizontalChange; + Container.Top = Container.Top + e.VerticalChange; + } + + /// + /// Sets the MessageBoxResult according to the button pressed and then closes the MessageBox. + /// + /// The source of the event. + /// The instance containing the event data. + private void Button_Click(object sender, RoutedEventArgs e) + { + Button button = e.Source as Button; + switch (button.Name) + { + case "PART_NoButton": + case "PART_NoButton1": + MessageBoxResult = MessageBoxResult.No; + break; + case "PART_YesButton": + case "PART_YesButton1": + MessageBoxResult = MessageBoxResult.Yes; + break; + case "PART_CancelButton": + case "PART_CancelButton1": + MessageBoxResult = MessageBoxResult.Cancel; + break; + case "PART_OkButton": + case "PART_OkButton1": + MessageBoxResult = MessageBoxResult.OK; + break; + } + + Close(); + } + + /// + /// Closes the MessageBox. + /// + private void Close() + { + Container.Close(); + } + + #endregion //Event Handlers + } +} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.xaml new file mode 100644 index 00000000..a2cedd9a --- /dev/null +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.xaml @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/VisualStates.MessageBox.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/VisualStates.MessageBox.cs new file mode 100644 index 00000000..d47fcb08 --- /dev/null +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/VisualStates.MessageBox.cs @@ -0,0 +1,17 @@ +using System; + +namespace Microsoft.Windows.Controls +{ + internal static partial class VisualStates + { + public const string MessageBoxButtonsGroup = "MessageBoxButtonsGroup"; + + public const string OK = "OK"; + + public const string OKCancel = "OKCancel"; + + public const string YesNo = "YesNo"; + + public const string YesNoCancel = "YesNoCancel"; + } +} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/AssemblyInfo.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/AssemblyInfo.cs index aa6bc73c..4826befc 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/AssemblyInfo.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0803.0")] -[assembly: AssemblyFileVersion("1.0.0803.0")] +[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml index b22e5043..35d1ebe8 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml @@ -1,4 +1,4 @@ - @@ -138,5 +138,300 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj index de00c6d1..16b46b7b 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj @@ -57,6 +57,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -64,6 +68,7 @@ + Code @@ -79,6 +84,7 @@ + ResXFileCodeGenerator Resources.Designer.cs @@ -89,6 +95,12 @@ + + + + + +