Esempio n. 1
0
 private static void OnSystemParametersStaticPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(SystemParameters.HighContrast) && SystemParameters.HighContrast)
     {
         StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(null));
     }
 }
Esempio n. 2
0
 // 通知属性改变
 private static void RaisePropertyChanged(string propertyName)
 {
     if (StaticPropertyChanged != null)
     {
         StaticPropertyChanged.Invoke(null, new PropertyChangedEventArgs(propertyName));
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Sets given property and notifies listeners of its change. IGNORES setting the property to same value.
 /// Should be called in property setters.
 /// </summary>
 /// <typeparam name="T">Type of given property.</typeparam>
 /// <param name="field">Backing field to update.</param>
 /// <param name="value">New value of property.</param>
 /// <param name="propertyName">Name of property.</param>
 /// <returns>True if success, false if backing field and new value aren't compatible.</returns>
 private static bool SetProperty <T>(ref T field, T value, [CallerMemberName] string propertyName = "")
 {
     if (EqualityComparer <T> .Default.Equals(field, value))
     {
         return(false);
     }
     field = value;
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyName));
     return(true);
 }
Esempio n. 4
0
        public static void SetProperty <T>(ref T storage, T value, [CallerMemberName] string property = null)
        {
            // Set new value if it is changed
            if (Equals(storage, value))
            {
                return;
            }
            storage = value;

            // Set a change event
            StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(property));
        }
Esempio n. 5
0
        public static void Log(string message, params object[] arguments)
        {
            DiagnosticsData diagnosticsData;

            Thread currentThread = System.Threading.Thread.CurrentThread;
            int    threadId      = currentThread.ManagedThreadId;

            lock (Debug.diagnosticsDataById)
            {
                if (!Debug.diagnosticsDataById.TryGetValue(threadId, out diagnosticsData))
                {
                    string threadName = Debug.threadCount > 0 ? $"{currentThread.Name} ({Debug.threadCount})" : "Application";
                    diagnosticsData = new DiagnosticsData(threadName);
                    diagnosticsData.Initialize(Debug.diagnosticsFolderPath, threadId);
                    Debug.diagnosticsDataById.Add(threadId, diagnosticsData);
                    Debug.threadCount++;

                    StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs("Data"));
                }
            }

            diagnosticsData.Log(message, arguments);
        }
Esempio n. 6
0
        protected virtual void OnPropertyChanged(string propName, bool postMainThread = false)
        {
            //try
            //{
            if (postMainThread)
            {
                Common_liby.InvokeMethodOnMainThread(() =>
                {
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
                    StaticPropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
                });
            }
            else
            {
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
                StaticPropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
            }
            //}
            //catch (Exception ex)
            //{

            //}
        }
Esempio n. 7
0
 private static void OnStaticPropertyChanged([CallerMemberName] string propName = "")
 => StaticPropertyChanged?.Invoke(Instance, new PropertyChangedEventArgs(propName));
Esempio n. 8
0
 /// <summary>
 /// calls the StaticPropertyChanged to notify window controls
 /// </summary>
 /// <param name="property">static property that changed</param>
 private static void OnStaticPropertyChanged(string property)
 {
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(property));
 }
 private static void NotifyStaticPropertyChanged([CallerMemberName] string name = null)
 {
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(name));
 }
 public static void TooltipChanged(string property)
 {
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(property));
 }
 static void OnStaticPropertyChanged(string name)
 {
     StaticPropertyChanged?.Invoke(null, new System.ComponentModel.PropertyChangedEventArgs(name));
 }
 public static void OnPropertyChanged(string propertyName) => StaticPropertyChanged?.Invoke(typeof(LoggingModel), new PropertyChangedEventArgs(propertyName));
Esempio n. 13
0
 static void OnStaticPropertyChanged(string name)
 {
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(name));
 }
Esempio n. 14
0
 public static event PropertyChangedEventHandler StaticPropertyChanged;//erre fel kell iratkozni konstruktorban
 protected static void RaiseStaticPropertyChanged(string propertyName)
 {
     StaticPropertyChanged?.Invoke(/*this*/ null, new PropertyChangedEventArgs(propertyName));
 }
Esempio n. 15
0
 public static void StaticRaisePropertyChanged(string propertyName)
 {
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyName));
 }
Esempio n. 16
0
 private static void OnStaticPropertyChanged(string PropertyName)
 {
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(PropertyName));
 }
Esempio n. 17
0
 private static void RaiseStaticPropertyChanged(string name) =>
 StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(name));
Esempio n. 18
0
 public static void OnStaticPropertyChanged(string className, string propertyName)
 {
     StaticPropertyChanged?.Invoke(null, new StaticPropertyChangedEventArgs(className, propertyName));
 }
Esempio n. 19
0
 public static void OnPropertyChanged(string _name)
 {
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(_name));
 }
Esempio n. 20
0
 protected static void OnStaticPropertyChanged([CallerMemberName] string propertyName = "")
 {
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyName));
 }
Esempio n. 21
0
 static void OnStaticPropertyChanged(string propertyName)
 {
     StaticPropertyChanged?.Invoke(typeof(WindowContentManagement), new PropertyChangedEventArgs(propertyName));
 }
 public static void RaiseStaticPropertyChanged(string PropertyName)
 {
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(PropertyName));
 }         // RaiseStaticPropertyChanged()
Esempio n. 23
0
 protected static void OnStaticPropertyChange(string name) => StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(name));
 internal static void ModeSwitched()
 {
     StaticPropertyChanged?.Invoke(null, TreeViewMarginEventArgs);
     StaticPropertyChanged?.Invoke(null, InterpreterWPFNodeMarginEventArgs);
 }
Esempio n. 25
0
File: URD.cs Progetto: rusith/URD
 public static void NotifyStaticPropertyChange(string propertyname)
 {
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyname));
 }
Esempio n. 26
0
 private static void NotifyStaticPropertyChanged(string propertyName)
 {
     StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyName));
 }
Esempio n. 27
0
 private static void OnStaticPropertyChanged(object sender) => StaticPropertyChanged?.Invoke(sender, new EventArgs());
Esempio n. 28
0
 public static void RaiseStaticPropertyChanged([CallerMemberName] string propertyName = null) =>
 StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyName));
Esempio n. 29
0
 public new void Reload()
 {
     defaultInstance = configuration.Get <Settings>();
     StaticPropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Default)));
 }