コード例 #1
0
        private static void AddClass(ListClasses control, string classname)
        {
            TextBlock textBlockClassName = new TextBlock();

            textBlockClassName.Margin     = new Thickness(10, 5, 0, 0);
            textBlockClassName.FontWeight = FontWeights.Black;
            textBlockClassName.Text       = classname;
            control.classesListStackPanel.Children.Add(textBlockClassName);
        }
コード例 #2
0
        private static void OnListClassesNamePropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e)
        {
            ListClasses control = source as ListClasses;

            control.classesListStackPanel.Children.Clear();
            string[] listClasses = (string[])e.NewValue;
            if (listClasses != null)
            {
                listClasses.ToList().ForEach(className => AddClass(control, className));
            }
        }