private async void Window_Loaded(object sender, RoutedEventArgs e)
        {//load
            try
            {
                if (sender != null)
                {
                    HelpClass.StartAwait(grid_mainGrid);
                }
                //windowFlowDirection();
                menuList = new List <string> {
                    "applications", "sales", "reports",
                    "sectionData", "settings"
                };

                translate();

                #region loading
                loadingList = new List <keyValueBool>();
                bool isDone = true;
                loadingList.Add(new keyValueBool {
                    key = "loading_getGroupObjects", value = false
                });
                //loadingList.Add(new keyValueBool { key = "loading_getUserPath", value = false });
                //loadingList.Add(new keyValueBool { key = "loading_getTax", value = false });
                //loadingList.Add(new keyValueBool { key = "loading_getDateForm", value = false });
                //loadingList.Add(new keyValueBool { key = "loading_getRegionAndCurrency", value = false });
                //loadingList.Add(new keyValueBool { key = "loading_getStorageCost", value = false });
                //loadingList.Add(new keyValueBool { key = "loading_getAccurac", value = false });
                loadingList.Add(new keyValueBool {
                    key = "loading_getUserPersonalInfo", value = false
                });
                //loadingList.Add(new keyValueBool { key = "loading_getDefaultSystemInfo", value = false });
                //loadingList.Add(new keyValueBool { key = "loading_getItemUnitsUsers", value = false });
                //loadingList.Add(new keyValueBool { key = "loading_getprintSitting", value = false });
                //loadingList.Add(new keyValueBool { key = "loading_GlobalItemUnitsList", value = false });
                //loadingList.Add(new keyValueBool { key = "loading_GlobalUnitsList", value = false });
                //loadingList.Add(new keyValueBool { key = "loading_POSList", value = false });

                await FillCombo.loading_getDefaultSystemInfo();

                await FillCombo.Getprintparameter();

                loading_getGroupObjects();
                await FillCombo.RefreshCountry();

                FillCombo.fillRegion();
                //loading_getUserPath();
                //loading_getTax();
                //loading_getDateForm();
                //loading_getRegionAndCurrency();
                //loading_getStorageCost();
                //loading_getAccurac();
                //loading_getItemUnitsUsers();
                loading_getUserPersonalInfo();
                //loading_getDefaultSystemInfo();
                //loading_getprintSitting();
                //loading_GlobalItemUnitsList();
                //loading_GlobalUnitsList();
                //loading_POSList();

                do
                {
                    isDone = true;
                    foreach (var item in loadingList)
                    {
                        if (item.value == false)
                        {
                            isDone = false;
                            break;
                        }
                    }
                    if (!isDone)
                    {
                        //MessageBox.Show("not done");
                        //string s = "";
                        //foreach (var item in loadingList)
                        //{
                        //    s += item.name + " - " + item.value + "\n";
                        //}
                        //MessageBox.Show(s);
                        await Task.Delay(0500);

                        //MessageBox.Show("do");
                    }
                }while (!isDone);
                #endregion

                if (MainWindow.userLogin.type == "ag")
                {
                    btn_applications.Visibility = Visibility.Collapsed;
                    btn_sectionData.Visibility  = Visibility.Collapsed;
                    btn_settings.Visibility     = Visibility.Collapsed;

                    Btn_sales_Click(btn_sales, null);
                }
                else
                {
                    Btn_applications_Click(btn_applications, null);
                }
                if (sender != null)
                {
                    HelpClass.EndAwait(grid_mainGrid);
                }
            }
            catch (Exception ex)
            {
                if (sender != null)
                {
                    HelpClass.EndAwait(grid_mainGrid);
                }
                HelpClass.ExceptionMessage(ex, this);
            }
        }