{"id":279759,"date":"2016-05-08T01:50:02","date_gmt":"2016-05-07T21:50:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=279759"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=279759","title":{"rendered":"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 (CustomControl) \u043d\u0430 WPF"},"content":{"rendered":"<br \/>\n<h1>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h1>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u044f \u043f\u0438\u0441\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 \u043e <a href=\"https:\/\/habrahabr.ru\/post\/263847\/\">\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 WinForms<\/a>, \u043e <a href=\"https:\/\/habrahabr.ru\/post\/266725\/\">\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 WPF \u0432 \u0441\u0442\u0438\u043b\u0435 WinForms<\/a>, \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 WPF, \u043d\u043e \u0432 \u201c\u0441\u0442\u0438\u043b\u0435 WPF\u201d. <br \/>  \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h1>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h1>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u0436\u0434\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432\u0430 \u0414\u041f\u041a. \u0421\u043b\u043e\u0432\u043e \u0414\u041f\u041a 32-\u0445 \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0435, \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0430\u0434\u0440\u0435\u0441\u0430 \u2013 8 \u0431\u0438\u0442 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 24 \u0431\u0438\u0442\u0430. \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/1fd\/717\/e01\/1fd717e01b2a49abbc46210620101729.png\"\/><\/p>\n<h1>\u0412\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h1>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u201c\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u201d \u2013 \u043f\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0438 Visual Studio.<br \/>  \u0421\u043e\u0437\u0434\u0430\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438:  <\/p>\n<ul>\n<li>Debug_WpfApplication \u2013 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438;<\/li>\n<li>WpfCustomControlLibrary \u2013 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c.<\/li>\n<\/ul>\n<p>  \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 Visual Studio.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d06\/7c8\/560\/d067c85607c845558e277d4d32b42e43.png\"\/><\/p>\n<h1>\u0420\u0430\u0437\u0431\u043e\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h1>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0438\u0441\u0443\u043d\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441\u043b\u043e\u0432\u0430 \u0414\u041f\u041a (CustomDpkView) \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 4-\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439:  <\/p>\n<ul>\n<li>\u00abTextBlock\u00bb \u0410\u0434\u0440\u0435\u0441;<\/li>\n<li>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0441 1 \u043f\u043e 8 \u0431\u0438\u0442 (\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 CustomBinView);<\/li>\n<li>\u00abTextBlock\u00bb \u0414\u0430\u043d\u043d\u044b\u0435;<\/li>\n<li>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 9 \u043f\u043e 32 \u0431\u0438\u0442 (\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 CustomBinView);<\/li>\n<\/ul>\n<p>  \u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u0436\u0435 \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u044d\u0442\u0438 \u0434\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 CustomBinView \u0438 CustomDpkView?<br \/>  \u041f\u043e\u043b\u044f \u0438 \u043c\u0435\u0442\u043e\u0434\u044b (\u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435) \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u00ab*.cs\u00bb \u0444\u0430\u0439\u043b\u0430\u0445 \u0438 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u043a\u0435\u0442 (\u0441\u0442\u0438\u043b\u044c) \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0444\u0430\u0439\u043b\u0435 \u00abGeneric.xaml\u00bb.<\/p>\n<h1>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 CustomBinView<\/h1>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e10\/b47\/a6f\/e10b47a6fee64a53a0d22e127ddddec7.png\"\/><br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u00abCustomBinView.cs\u00bb. <br \/>  \u0417\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u044b DependecyPropery \u0438 \u0438\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 1<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>\/\/\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043e\u043b-\u0432\u0430 \u044f\u0447\u0435\u0435\u043a         const int DEFAULT_CNT=8;         static CustomBinView()          {             \/\/\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f             DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomBinView), new FrameworkPropertyMetadata(typeof(CustomBinView)));             ArrayList temp = new ArrayList(DEFAULT_CNT);             for (int i = 0; i &lt; DEFAULT_CNT; i++) temp.Add(true);             ValuesProperty = DependencyProperty.Register(&quot;Values&quot;, typeof(ArrayList), typeof(CustomBinView), new FrameworkPropertyMetadata(temp, new PropertyChangedCallback(InvalidateVisualCallback)));             FirstNumberProperty = DependencyProperty.Register(&quot;FirstNumber&quot;, typeof(int), typeof(CustomBinView), new FrameworkPropertyMetadata(new PropertyChangedCallback(InvalidateVisualCallback)));             ColorTrueProperty = DependencyProperty.Register(&quot;ColorTrue&quot;, typeof(Brush), typeof(CustomBinView), new FrameworkPropertyMetadata(new PropertyChangedCallback(InvalidateVisualCallback)));             ColorFalseProperty = DependencyProperty.Register(&quot;ColorFalse&quot;, typeof(Brush), typeof(CustomBinView), new FrameworkPropertyMetadata(new PropertyChangedCallback(InvalidateVisualCallback)));             IsVisibleTextProperty = DependencyProperty.Register(&quot;IsVisibleText&quot;, typeof(bool), typeof(CustomBinView), new FrameworkPropertyMetadata(new PropertyChangedCallback(InvalidateVisualCallback)));         }         \/\/\u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u0432\u043b\u0438\u044f\u044e\u0449\u0438\u0445 \u043d\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434 - \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442         private static void InvalidateVisualCallback(DependencyObject sender, DependencyPropertyChangedEventArgs e) { ((CustomBinView)sender).InvalidateVisual(); }         \/\/------------------------------------------------------------------------------------------\/\/         #region DependencyProperty \u0438 \u0438\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f             public static DependencyProperty ValuesProperty;             public static DependencyProperty FirstNumberProperty;             public static DependencyProperty ColorTrueProperty;             public static DependencyProperty ColorFalseProperty;             public static DependencyProperty IsVisibleTextProperty;               #endregion         \/\/------------------------------------------------------------------------------------------\/\/         #region \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c DependencyProperty             \/\/\u042f\u0447\u0435\u0439\u043a\u0438 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438             public ArrayList Values { get { return (ArrayList)GetValue(ValuesProperty); } set { SetValue(ValuesProperty, value); } }             \/\/\u041d\u043e\u043c\u0435\u0440, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u044f\u0447\u0435\u0439\u043a\u0438             public int FirstNumber { get { return (int)GetValue(FirstNumberProperty); } set { SetValue(FirstNumberProperty, value); } }             \/\/\u0426\u0432\u0435\u0442 true-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f             public Brush ColorTrue { get { return (Brush)GetValue(ColorTrueProperty); } set { SetValue(ColorTrueProperty, value); } }             \/\/\u0446\u0432\u0435\u0442 false-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f             public Brush ColorFalse { get { return (Brush)GetValue(ColorFalseProperty); } set { SetValue(ColorFalseProperty, value); } }             \/\/\u041f\u0440\u0438\u0437\u043d\u0430\u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u044f\u0447\u0435\u0439\u043a\u0430\u0445             public bool IsVisibleText { get { return (bool)GetValue(IsVisibleTextProperty); } set { SetValue(IsVisibleTextProperty, value); } }          #endregion <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0438\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043a\u043b\u0438\u043a\u0430 \u043f\u043e \u044f\u0447\u0435\u0439\u043a\u0430\u043c.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 2<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)         {\/\/\u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435             base.OnRenderSizeChanged(sizeInfo);             InvalidateVisual();         }         protected override void OnRender(DrawingContext drawingContext)         {             base.OnRender(drawingContext);             DrawingContext dc = drawingContext;             \/\/\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0444\u043e\u043d\u0430 \u0438 \u0433\u0440\u0438\u043d\u0438\u0446             dc.DrawRectangle(Background, null, new Rect(new Point(0, 0), RenderSize));             #region \u0420\u0430\u0441\u0447\u0451\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0439                 if ((Values == null) || (Values.Count == 0)) return;                 double FullWidthCell = RenderSize.Width \/ (double)(Values.Count);                 double WidthCell = FullWidthCell;                 double HeightCell = RenderSize.Height;                 if ((WidthCell &gt; 2) && (HeightCell &gt; 2)) { WidthCell -= 2; HeightCell -= 2; }              #endregion             #region \u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u044f\u0447\u0435\u0435\u043a                 \/\/\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u043d\u043e\u043c\u0435\u0440 \u044f\u0447\u0435\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u044f\u0447\u0435\u0439\u043a\u0435                 int currentNumber = FirstNumber;                 \/\/\u0442\u043e\u0447\u043a\u0430-\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0440\u0438\u0441\u0443\u044e\u0449\u0443\u044e\u0441\u044f \u044f\u0447\u0435\u0439\u043a\u0443                  Point currentPointCell = new Point(1, 1);                 \/\/\u0420\u0430\u0437\u043c\u0435\u0440 \u0434\u043b\u0438\u043d\u044b \u043e\u043a\u0443\u0440\u0433\u043b\u0435\u043d\u0438\u044f \u044f\u0447\u0435\u0439\u043a\u0438                 double roundedLenght = ((0.15 * WidthCell) &gt; (0.15 * HeightCell)) ? (0.15 * HeightCell) : (0.15 * WidthCell);                 foreach (bool item in Values)\/\/\u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0432\u0441\u0435\u0445 \u044f\u0447\u0435\u0435\u043a                 {                     \/\/\u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u044f\u0447\u0435\u0439\u043a\u0438 \u0441 \u0444\u043e\u043d\u043e\u043c                     dc.DrawRoundedRectangle((item) ? ColorTrue : ColorFalse, new Pen(BorderBrush, 1),                         new Rect(currentPointCell, new Size(WidthCell, HeightCell)),                         roundedLenght, roundedLenght);                     \/\/\u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u044f\u0447\u0435\u0439\u043a\u0438                     if (IsVisibleText)                          Service.DrawTxt(dc, currentNumber.ToString().PadLeft(2, '0'), currentPointCell, new Size(WidthCell, HeightCell),                              Foreground, this.FontFamily, this.FontStyle, this.FontWeight);                     \/\/\u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u044f\u0447\u0435\u0439\u043a\u0435                     currentPointCell.X += FullWidthCell;                     currentNumber++;                 }              #endregion             }         #region \u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 &quot;\u041a\u043b\u0438\u043a \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443&quot;             \/\/\u041a\u043b\u0430\u0441\u0441 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f             public class ClickItemRoutedEventArgs : RoutedEventArgs             {                 \/\/\u0418\u043d\u0434\u0435\u043a\u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (\u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u0441 0)                 public int Index { get; protected set; }                 \/\/\u0421\u0430\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442                 public object Item { get; protected set; }                 \/\/\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u043b\u0438\u043a\u0435 \u043c\u044b\u0448\u0438                 public MouseButtonEventArgs MouseEventArg { get; protected set; }                 public ClickItemRoutedEventArgs(RoutedEvent routedEvent, object item, int index, MouseButtonEventArgs arg)                     : base(routedEvent) { Item = item; Index = index; MouseEventArg = arg; }                 public ClickItemRoutedEventArgs()                     : base() { Item = null; Index = -1; MouseEventArg = null; }             }             \/\/\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f             public static readonly RoutedEvent ClickItemEvent = EventManager.RegisterRoutedEvent(&quot;ClickItem&quot;, RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(CustomBinView));             \/\/\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f-\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432             public event RoutedEventHandler ClickItem             {                 add { base.AddHandler(ClickItemEvent, value); }                 remove { base.RemoveHandler(ClickItemEvent, value); }             }             \/\/\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f             void RaiseClickItem(object item, int index, MouseButtonEventArgs arg)             {                 ClickItemRoutedEventArgs args = new ClickItemRoutedEventArgs(ClickItemEvent, item, index, arg);                 RaiseEvent(args);             }         #endregion         protected override void OnMouseUp(MouseButtonEventArgs e)\/\/\u041a\u043b\u0438\u043a \u043c\u044b\u0448\u043a\u043e\u0439 \u043f\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0443         {             base.OnMouseUp(e);             #region \u0420\u0430\u0441\u0447\u0451\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0439                 if ((Values == null) || (Values.Count == 0)) return;                 double FullWidthCell = RenderSize.Width \/ (double)(Values.Count);                 double WidthCell = FullWidthCell;                 double HeightCell = RenderSize.Height;                 if ((WidthCell &gt; 2) && (HeightCell &gt; 2)) { WidthCell -= 2; HeightCell -= 2; }                 Point currentPointCell = new Point(1, 1);              #endregion             for (int currentNumber = 0; currentNumber &lt; Values.Count; currentNumber++, currentPointCell.X += FullWidthCell)             {                 \/\/\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u043f\u043e \u044f\u0447\u0435\u0439\u043a\u0435                 if (new Rect(currentPointCell, new Size(WidthCell, HeightCell)).Contains(e.GetPosition(this)))                 {                     Values[currentNumber] = !(bool)Values[currentNumber];\/\/\u0418\u041d\u0432\u0435\u0440\u0441\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f                     this.InvalidateVisual();\/\/\u0412\u044b\u0437\u043e\u0432 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430                     RaiseClickItem(Values[currentNumber], currentNumber, e);\/\/\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u043b\u0438\u043a\u0430                 }             }         } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u00abGeneric.xaml\u00bb. \u0417\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u043d \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c (\u043c\u0430\u043a\u0435\u0442) \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 3<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">    &lt;!--\u0421\u0442\u0438\u043b\u044c CustomBinView--&gt;     &lt;Style TargetType=&quot;{x:Type local:CustomBinView}&quot;&gt;         &lt;!--\u0421\u0442\u0438\u043b\u044c \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 CustomBinView         \u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043f\u043e\u043b\u044f\u043c \u0432 CustomBinView.cs \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e--&gt;         &lt;Setter Property=&quot;FirstNumber&quot; Value=&quot;1&quot;\/&gt;         &lt;Setter Property=&quot;ColorTrue&quot;&gt;             &lt;Setter.Value&gt;                 &lt;LinearGradientBrush EndPoint=&quot;0.5,1&quot; StartPoint=&quot;0.5,0&quot;&gt;                     &lt;GradientStop Color=&quot;WhiteSmoke&quot; Offset=&quot;0&quot; \/&gt;                     &lt;GradientStop Color=&quot;Red&quot; Offset=&quot;1&quot; \/&gt;                 &lt;\/LinearGradientBrush&gt;             &lt;\/Setter.Value&gt;         &lt;\/Setter&gt;         &lt;Setter Property=&quot;ColorFalse&quot;&gt;             &lt;Setter.Value&gt;                 &lt;LinearGradientBrush EndPoint=&quot;0.5,1&quot; StartPoint=&quot;0.5,0&quot;&gt;                     &lt;GradientStop Color=&quot;WhiteSmoke&quot; Offset=&quot;0&quot; \/&gt;                     &lt;GradientStop Color=&quot;Gray&quot; Offset=&quot;1&quot; \/&gt;                 &lt;\/LinearGradientBrush&gt;             &lt;\/Setter.Value&gt;         &lt;\/Setter&gt;         &lt;Setter Property=&quot;BorderBrush&quot; Value=&quot;Black&quot; \/&gt;         &lt;Setter Property=&quot;IsVisibleText&quot; Value=&quot;True&quot;\/&gt;         &lt;Setter Property=&quot;FontFamily&quot; Value=&quot;Courier New&quot;\/&gt;         &lt;Setter Property=&quot;FontStyle&quot; Value=&quot;Normal&quot;\/&gt;         &lt;Setter Property=&quot;FontWeight&quot; Value=&quot;Normal&quot;\/&gt;         &lt;Setter Property=&quot;MinHeight&quot; Value=&quot;20&quot;\/&gt;         &lt;Setter Property=&quot;MinWidth&quot; Value=&quot;50&quot;\/&gt;     &lt;\/Style&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h1>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 CustomDpkView<\/h1>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u00abCustomDpkView.cs\u00bb. \u0417\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u044b DependencyProperty \u0438 \u0438\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 4<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>public class CustomDpkView : Control     {         public static DependencyProperty ValuesADRProperty;          public static DependencyProperty ValuesDATAProperty;         public static DependencyProperty ColorTrueProperty;         public static DependencyProperty ColorFalseProperty;         public const int CNT_ADR_BIT = 8;\/\/\u041a\u043e\u043b-\u0432\u043e \u0431\u0438\u0442 \u0432 \u043f\u043e\u043b\u0435 \u0430\u0434\u0440\u0435\u0441 \u0414\u041f\u041a         public const int CNT_DATA_BIT = 24;\/\/\u041a\u043e\u043b-\u0432\u043e \u0431\u0438\u0442 \u0432 \u043f\u043e\u043b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435         static CustomDpkView()         {             DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomDpkView), new FrameworkPropertyMetadata(typeof(CustomDpkView)));             #region \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f ValuesADRProperty                 ArrayList temp = new ArrayList(CNT_ADR_BIT);                 for (int i = 0; i &lt; CNT_ADR_BIT; i++) temp.Add(true);                 ValuesADRProperty = DependencyProperty.Register(&quot;ValuesADR&quot;, typeof(ArrayList), typeof(CustomDpkView), new PropertyMetadata(temp));              #endregion             #region \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f ValuesDATAProperty                 temp = new ArrayList(24);                 for (int i = 0; i &lt; 24; i++) temp.Add(true);                 ValuesDATAProperty = DependencyProperty.Register(&quot;ValuesDATA&quot;, typeof(ArrayList), typeof(CustomDpkView), new PropertyMetadata(temp));              #endregion             ColorTrueProperty = DependencyProperty.Register(&quot;ColorTrue&quot;, typeof(Brush), typeof(CustomDpkView));             ColorFalseProperty = DependencyProperty.Register(&quot;ColorFalse&quot;, typeof(Brush), typeof(CustomDpkView));                     }         \/\/\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0438\u0442 \u0432 \u043f\u043e\u043b\u0435 \u0410\u0434\u0440\u0435\u0441 (8 \u0431\u0438\u0442)         public ArrayList ValuesADR { get { return (ArrayList)GetValue(ValuesADRProperty); } protected set { SetValue(ValuesADRProperty, value); } }         \/\/\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0438\u0442 \u0432 \u043f\u043e\u043b\u0435 \u0414\u0410\u043d\u043d\u044b\u0435 (24 \u0431\u0438\u0442\u0430)         public ArrayList ValuesDATA { get { return (ArrayList)GetValue(ValuesDATAProperty); } protected set { SetValue(ValuesDATAProperty, value); } }         \/\/\u0426\u0432\u0435\u0442 true - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f         public Brush ColorTrue { get { return (Brush)GetValue(ColorTrueProperty); } set { SetValue(ColorTrueProperty, value); } }         \/\/\u0426\u0432\u0435\u0442 false - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f         public Brush ColorFalse { get { return (Brush)GetValue(ColorFalseProperty); } set { SetValue(ColorFalseProperty, value); } }         #region \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445             public bool SetValuesADR(ArrayList array)             {                 if (array.Count != CNT_ADR_BIT) return false;                 ValuesADR = array;                 return true;             }             public bool SetValuesDATA(ArrayList array)             {                 if (array.Count != CNT_DATA_BIT) return false;                 ValuesDATA = array;                 return true;             }         #endregion     } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u00abGeneric.xaml\u00bb. \u0417\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u043d \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c (\u043c\u0430\u043a\u0435\u0442) \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u0435\u0433\u043e \u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 5<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;!--\u0421\u0442\u0438\u043b\u044c CustomDpkView--&gt;     &lt;Style TargetType=&quot;TextBlock&quot; x:Key=&quot;labelStyle&quot;&gt;&lt;!--\u0421\u0442\u0438\u043b\u044c \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0430\u0434\u0440\u0435\u0441 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435--&gt;         &lt;Setter Property=&quot;TextAlignment&quot; Value=&quot;Center&quot;\/&gt;         &lt;Setter Property=&quot;FontFamily&quot; Value=&quot;Comic Sans MS&quot;\/&gt;         &lt;Setter Property=&quot;FontWeight&quot; Value=&quot;Bold&quot;\/&gt;         &lt;Setter Property=&quot;FontSize&quot; Value=&quot;20&quot;\/&gt;     &lt;\/Style&gt;          &lt;Style TargetType=&quot;{x:Type local:CustomDpkView}&quot;&gt;&lt;!--\u0421\u0442\u0438\u043b\u044c \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 CustomDpkView--&gt;         &lt;Setter Property=&quot;Template&quot;&gt;             &lt;Setter.Value&gt;&lt;!--\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430--&gt;                 &lt;ControlTemplate TargetType=&quot;{x:Type local:CustomDpkView}&quot;&gt;                     &lt;Grid&gt;                         &lt;Grid.RowDefinitions&gt;&lt;!--\u0420\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 4 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (\u0441\u043e \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u043e\u0439 - \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0435, \u0431\u0435\u0437 - \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435)--&gt;                             &lt;RowDefinition Height=&quot;30&quot; \/&gt;                             &lt;RowDefinition Height=&quot;30*&quot; MinHeight=&quot;30&quot; \/&gt;                             &lt;RowDefinition Height=&quot;30&quot; \/&gt;                             &lt;RowDefinition Height=&quot;30*&quot; MinHeight=&quot;30&quot;\/&gt;                         &lt;\/Grid.RowDefinitions&gt;                         &lt;!--\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0410\u0434\u0440\u0435\u0441--&gt;                         &lt;TextBlock Style=&quot;{StaticResource labelStyle}&quot; Grid.Row=&quot;0&quot; Text=&quot;\u0410\u0434\u0440\u0435\u0441:&quot;\/&gt;                         &lt;!--\u0414\u0432\u043e\u0438\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f \u0410\u0434\u0440\u0435\u0441--&gt;                         &lt;!--\u0421\u0432\u044f\u0437\u043a\u0430 \u043f\u043e\u043b\u0435\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e TemplateBinding                         \u0432 CustomDpkView.cs \u0441 \u043f\u043e\u043b\u044f\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 CustomBinView--&gt;                         &lt;local:CustomBinView FirstNumber=&quot;1&quot; Grid.Row=&quot;1&quot;                                               ColorTrue=&quot;{TemplateBinding ColorTrue}&quot;                                               ColorFalse=&quot;{TemplateBinding ColorFalse}&quot;                                                Values=&quot;{TemplateBinding ValuesADR}&quot;\/&gt;                         &lt;!--\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0414\u0430\u043d\u043d\u044b\u0435--&gt;                         &lt;TextBlock Style=&quot;{StaticResource labelStyle}&quot; Grid.Row=&quot;2&quot; Text=&quot;\u0414\u0430\u043d\u043d\u044b\u0435:&quot;\/&gt;                         &lt;!--\u0414\u0432\u043e\u0438\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f \u0414\u0430\u043d\u043d\u044b\u0435--&gt;                         &lt;!--\u0421\u0432\u044f\u0437\u043a\u0430 \u043f\u043e\u043b\u0435\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e TemplateBinding                         \u0432 CustomDpkView.cs \u0441 \u043f\u043e\u043b\u044f\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 CustomBinView--&gt;                         &lt;local:CustomBinView FirstNumber=&quot;9&quot; Grid.Row=&quot;3&quot;                                               ColorTrue=&quot;{TemplateBinding ColorTrue}&quot;                                              ColorFalse=&quot;{TemplateBinding ColorFalse}&quot;                                               Values=&quot;{TemplateBinding ValuesDATA}&quot;\/&gt;                     &lt;\/Grid&gt;                 &lt;\/ControlTemplate&gt;             &lt;\/Setter.Value&gt;         &lt;\/Setter&gt;         &lt;!--\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u044f \u0432 CustomDpkView.cs--&gt;         &lt;Setter Property=&quot;ColorTrue&quot;&gt;             &lt;Setter.Value&gt;                 &lt;LinearGradientBrush EndPoint=&quot;0.5,1&quot; StartPoint=&quot;0.5,0&quot;&gt;                     &lt;GradientStop Color=&quot;WhiteSmoke&quot; Offset=&quot;0&quot; \/&gt;                     &lt;GradientStop Color=&quot;Red&quot; Offset=&quot;1&quot; \/&gt;                 &lt;\/LinearGradientBrush&gt;             &lt;\/Setter.Value&gt;         &lt;\/Setter&gt;         &lt;!--\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u044f \u0432 CustomDpkView.cs--&gt;         &lt;Setter Property=&quot;ColorFalse&quot;&gt;             &lt;Setter.Value&gt;                 &lt;LinearGradientBrush EndPoint=&quot;0.5,1&quot; StartPoint=&quot;0.5,0&quot;&gt;                     &lt;GradientStop Color=&quot;WhiteSmoke&quot; Offset=&quot;0&quot; \/&gt;                     &lt;GradientStop Color=&quot;Gray&quot; Offset=&quot;1&quot; \/&gt;                 &lt;\/LinearGradientBrush&gt;             &lt;\/Setter.Value&gt;         &lt;\/Setter&gt;     &lt;\/Style&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h1>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432 Debug_WpfApplication<\/h1>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u00abMain.xaml\u00bb.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7c7\/d6a\/051\/7c7d6a0512ce436baffba3763087d51e.png\"\/>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 6<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;Window.Resources&gt; &lt;!-- \u0421\u0442\u0438\u043b\u044c \u0434\u043b\u044f customDpkView1 --&gt;         &lt;Style TargetType=&quot;{x:Type ccl:CustomDpkView}&quot; x:Key=&quot;dpkViewStyle_1&quot;&gt;             &lt;Setter Property=&quot;ColorTrue&quot;&gt;                 &lt;Setter.Value&gt;                     &lt;LinearGradientBrush EndPoint=&quot;0.5,1&quot; StartPoint=&quot;0.5,0&quot;&gt;                         &lt;GradientStop Color=&quot;WhiteSmoke&quot; Offset=&quot;0&quot; \/&gt;                         &lt;GradientStop Color=&quot;Yellow&quot; Offset=&quot;1&quot; \/&gt;                     &lt;\/LinearGradientBrush&gt;                 &lt;\/Setter.Value&gt;             &lt;\/Setter&gt;             &lt;Setter Property=&quot;ColorFalse&quot;&gt;                 &lt;Setter.Value&gt;                     &lt;LinearGradientBrush EndPoint=&quot;0.5,1&quot; StartPoint=&quot;0.5,0&quot;&gt;                         &lt;GradientStop Color=&quot;Gray&quot; Offset=&quot;0&quot; \/&gt;                         &lt;GradientStop Color=&quot;White&quot; Offset=&quot;1&quot; \/&gt;                     &lt;\/LinearGradientBrush&gt;                 &lt;\/Setter.Value&gt;             &lt;\/Setter&gt;         &lt;\/Style&gt;     &lt;\/Window.Resources&gt;     &lt;Grid&gt;         &lt;Grid.RowDefinitions&gt;             &lt;RowDefinition Height=&quot;114&quot; \/&gt;             &lt;RowDefinition MinHeight=&quot;50&quot; Height=&quot;114*&quot; \/&gt;             &lt;RowDefinition Height=&quot;50&quot; \/&gt;         &lt;\/Grid.RowDefinitions&gt;         &lt;ccl:CustomBinView  Name=&quot;customBinView1&quot; Margin=&quot;12,12,12,20&quot; \/&gt; &lt;!-- CustomDpkView \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0441\u0442\u0438\u043b\u0435\u043c --&gt;         &lt;ccl:CustomDpkView Style=&quot;{StaticResource dpkViewStyle_1}&quot; Name=&quot;customDpkView1&quot; Grid.Row=&quot;1&quot; Height=&quot;174&quot; VerticalAlignment=&quot;Top&quot; Margin=&quot;12,0&quot; \/&gt;         &lt;TextBlock Name=&quot;textBlock1&quot; Text=&quot;TextBlock&quot; Grid.Row=&quot;2&quot; TextAlignment=&quot;Center&quot; FontStretch=&quot;Normal&quot; FontFamily=&quot;Comic Sans MS&quot; FontWeight=&quot;Bold&quot; FontSize=&quot;20&quot; Margin=&quot;0,0,429,0&quot; \/&gt;         &lt;Button Content=&quot;Button&quot; Grid.Row=&quot;2&quot; Name=&quot;button1&quot; HorizontalAlignment=&quot;Right&quot; Width=&quot;75&quot; Click=&quot;button1_Click&quot; \/&gt; &lt;!-- CustomDpkView \u0441\u043e \u0441\u0442\u0438\u043b\u0435\u043c \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e --&gt;         &lt;ccl:CustomDpkView Grid.Row=&quot;1&quot; Margin=&quot;12,180,12,0&quot; Name=&quot;customDpkView2&quot; VerticalAlignment=&quot;Top&quot; Height=&quot;133&quot; \/&gt;     &lt;\/Grid&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h1>P.S.<\/h1>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442: <a href=\"https:\/\/cloud.mail.ru\/public\/JTzj\/HWs3yaKKf\">\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442<\/a><br \/>  \u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0435\u043b\u0430\u0441\u044c \u0432 MS Visual Studio 2010 \u043f\u043e\u0434 \u00ab.Net Framework 4\u00bb<br \/>  \u0416\u0434\u0443 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439.               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/283124\/\"> https:\/\/habrahabr.ru\/post\/283124\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h1>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h1>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u044f \u043f\u0438\u0441\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 \u043e <a href=\"https:\/\/habrahabr.ru\/post\/263847\/\">\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 WinForms<\/a>, \u043e <a href=\"https:\/\/habrahabr.ru\/post\/266725\/\">\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 WPF \u0432 \u0441\u0442\u0438\u043b\u0435 WinForms<\/a>, \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 WPF, \u043d\u043e \u0432 \u201c\u0441\u0442\u0438\u043b\u0435 WPF\u201d. <br \/>  \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-279759","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/279759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=279759"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/279759\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=279759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=279759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=279759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}