コード例 #1
0
        private static void ShowPropWindow(Point position, Workday workday)
        {
#if TRACE
            INFO("WorkTable.ShowPropWindow");
#endif
            window.Top    = position.Y;
            window.Left   = position.X;
            window.Width  = workday.ActualWidth * 1.5d;
            window.Height = workday.ActualHeight * 1.1d;

            if (!window.IsVisible)
            {
                window.Show(workday.Arbeitstag, workday.DateTime);
            }
        }
コード例 #2
0
        private bool GetWorkday(int row, int column, out Workday workday)
        {
#if TRACE
            INFO($"WorkTable.GetWorkday from grid row:{row} col:{column}");
#endif
            foreach (UIElement child in Data.Children)
            {
                if (Grid.GetRow(child) == row && Grid.GetColumn(child) == column)
                {
                    workday = (Workday)child;
                    return(true);
                }
            }
            workday = default;
            return(false);
        }
コード例 #3
0
        /// <summary>
        /// Fills all possible fields with placeholders of <see cref="Workday"/> with empty <see cref="Arbeitstag"/>
        /// </summary>
        private void FillGridWithEmpty()
        {
#if TRACE
            INFO("WorkTable.FillGridWithEmpty");
#endif
            for (int i = 0; i < 42; i++)
            {
                Workday workday = new Workday()
                {
                    Arbeitstag = Arbeitstag.Zero,
                    Opacity    = 0.2d,
                    Focusable  = true
                };
                //workday.MouseDown += Focus_On_MouseDown;
                AddElementToCell(workday, i / 7, i % 7);
            }
        }