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

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

            #line default
            #line hidden

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

            #line default
            #line hidden
                return;

            case 2:
                this.labelImie = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.textBoxImie = ((Lab2.TextBoxWithErrorProvider)(target));
                return;

            case 4:
                this.labelNazwisko = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.textBoxNazwisko = ((Lab2.TextBoxWithErrorProvider)(target));
                return;

            case 6:
                this.labelWiek = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.labelWiekWartosc = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.sliderWiek = ((System.Windows.Controls.Slider)(target));
                return;

            case 9:
                this.labelWaga = ((System.Windows.Controls.Label)(target));
                return;

            case 10:
                this.labelWagaWartosc = ((System.Windows.Controls.Label)(target));
                return;

            case 11:
                this.sliderWaga = ((System.Windows.Controls.Slider)(target));
                return;

            case 12:
                this.buttonDodaj = ((System.Windows.Controls.Button)(target));

            #line 31 "..\..\MainWindow.xaml"
                this.buttonDodaj.Click += new System.Windows.RoutedEventHandler(this.buttonDodaj_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.buttonEdytuj = ((System.Windows.Controls.Button)(target));

            #line 32 "..\..\MainWindow.xaml"
                this.buttonEdytuj.Click += new System.Windows.RoutedEventHandler(this.buttonEdytuj_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.buttonUsun = ((System.Windows.Controls.Button)(target));

            #line 33 "..\..\MainWindow.xaml"
                this.buttonUsun.Click += new System.Windows.RoutedEventHandler(this.buttonUsun_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.LabelBledy = ((System.Windows.Controls.Label)(target));
                return;

            case 16:
                this.listBoxLista = ((System.Windows.Controls.ListBox)(target));

            #line 37 "..\..\MainWindow.xaml"
                this.listBoxLista.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.listBoxLista_SelectionChanged);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }