2 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 extern alias TizenSystemSettings;
19 using TizenSystemSettings.Tizen.System;
26 /// A static class which adds user handler to the SystemSettings.FontSizeChanged event.
27 /// This class also adds user handler to the last of the SystemSettings.FontSizeChanged event.
29 internal static class SystemFontSizeChangedManager
31 static SystemFontSizeChangedManager()
33 SystemSettings.FontSizeChanged += SystemFontSizeChanged;
37 /// The handler invoked last after all handlers added to the SystemSettings.FontSizeChanged event are invoked.
39 public static event EventHandler<FontSizeChangedEventArgs> Finished;
42 /// Adds the given handler to the SystemSettings.FontSizeChanged event.
44 /// <param name="handler">A handler to be added to the event</param>
45 public static void Add(EventHandler<FontSizeChangedEventArgs> handler)
51 /// Removes the given handler from the SystemSettings.FontSizeChanged event.
53 /// <param name="handler">A handler to be added to the event</param>
54 public static void Remove(EventHandler<FontSizeChangedEventArgs> handler)
56 proxy.Remove(handler);
59 private static void SystemFontSizeChanged(object sender, FontSizeChangedEventArgs args)
61 proxy.Invoke(sender, args);
62 Finished?.Invoke(sender, args);
65 private static WeakEvent<EventHandler<FontSizeChangedEventArgs>> proxy = new WeakEvent<EventHandler<FontSizeChangedEventArgs>>();