private bool IsNotEmpty(TextBoxWithErrorProvider tb)
 {
     if (tb.Text.Trim() == "")
     {
         tb.SetError("Pole nie może być puste!");
         return(false);
     }
     tb.SetError("");
     return(true);
 }
Beispiel #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 8 "..\..\MainWindow.xaml"
                ((Pilkarzproj.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.window_closing);

            #line default
            #line hidden

            #line 8 "..\..\MainWindow.xaml"
                ((Pilkarzproj.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.window_loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.button1 = ((System.Windows.Controls.Button)(target));

            #line 13 "..\..\MainWindow.xaml"
                this.button1.Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.button2 = ((System.Windows.Controls.Button)(target));

            #line 14 "..\..\MainWindow.xaml"
                this.button2.Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);

            #line default
            #line hidden
                return;

            case 4:
                this.button3 = ((System.Windows.Controls.Button)(target));

            #line 15 "..\..\MainWindow.xaml"
                this.button3.Click += new System.Windows.RoutedEventHandler(this.Button_Click_2);

            #line default
            #line hidden
                return;

            case 5:
                this.wagaslider = ((System.Windows.Controls.Slider)(target));
                return;

            case 6:
                this.ListBoxPilkarze = ((System.Windows.Controls.ListBox)(target));

            #line 17 "..\..\MainWindow.xaml"
                this.ListBoxPilkarze.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ListBoxPilkarze_SelectionChanged);

            #line default
            #line hidden
                return;

            case 7:
                this.wiekslider = ((System.Windows.Controls.Slider)(target));
                return;

            case 8:
                this.TextBoxWepImie = ((Pilkarzproj.TextBoxWithErrorProvider)(target));
                return;

            case 9:
                this.TextBoxWepNazwisko = ((Pilkarzproj.TextBoxWithErrorProvider)(target));
                return;
            }
            this._contentLoaded = true;
        }