Friday, June 10, 2011

WPF update other UI control from cyrrent window.

In our application sometimes we need that when we perform any cloud operation the it will take effect to other
UI control. hare is the sample:
  
private void LoadWMSComboInBuildingUI()
        {
            try
            {
                BuildingSetup obj;
                foreach (Window objWindow in Application.Current.Windows)
                {
                    string[] splitedNamespace = (objWindow.ToString()).Split('.');
                    string aClassNameFromCollection = splitedNamespace[splitedNamespace.Length - 1];
                    if (aClassNameFromCollection == "BuildingSetup")
                    {
                        obj = (BuildingSetup)objWindow;
                        obj.buildingTypecomboBox.Items.Clear();
                        BBuildingSetup ObjBBuildingSetup = new BBuildingSetup( foreach (EBuildingSetup objEclient in ObjBBuildingSetup.GetAllBuildingTYpe())
                        {
                                         obj.buildingTypecomboBox.Items.Add(objEclient.BuildingType);
                        }
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Combobox reloading problem", "Client Info", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }





Thank you.

C# print file on LAN Printer

If you want to print any file on network printer then you can try with this code block // Change Default Printer System.Ma...