예제 #1
0
        private void HandleLoaded(object sender, RoutedEventArgs e)
        {
            const double step   = Math.PI * 2 / 10.0;
            const double offset = Math.PI;

            C0.SetValue(Canvas.LeftProperty, 50.0 + Math.Sin(offset + 0.0 * step) * 50.0);
            C0.SetValue(Canvas.TopProperty, 50 + Math.Cos(offset + 0.0 * step) * 50.0);

            C1.SetValue(Canvas.LeftProperty, 50.0 + Math.Sin(offset + 1.0 * step) * 50.0);
            C1.SetValue(Canvas.TopProperty, 50 + Math.Cos(offset + 1.0 * step) * 50.0);

            C2.SetValue(Canvas.LeftProperty, 50.0 + Math.Sin(offset + 2.0 * step) * 50.0);
            C2.SetValue(Canvas.TopProperty, 50 + Math.Cos(offset + 2.0 * step) * 50.0);

            C3.SetValue(Canvas.LeftProperty, 50.0 + Math.Sin(offset + 3.0 * step) * 50.0);
            C3.SetValue(Canvas.TopProperty, 50 + Math.Cos(offset + 3.0 * step) * 50.0);

            C4.SetValue(Canvas.LeftProperty, 50.0 + Math.Sin(offset + 4.0 * step) * 50.0);
            C4.SetValue(Canvas.TopProperty, 50 + Math.Cos(offset + 4.0 * step) * 50.0);

            C5.SetValue(Canvas.LeftProperty, 50.0 + Math.Sin(offset + 5.0 * step) * 50.0);
            C5.SetValue(Canvas.TopProperty, 50 + Math.Cos(offset + 5.0 * step) * 50.0);

            C6.SetValue(Canvas.LeftProperty, 50.0 + Math.Sin(offset + 6.0 * step) * 50.0);
            C6.SetValue(Canvas.TopProperty, 50 + Math.Cos(offset + 6.0 * step) * 50.0);

            C7.SetValue(Canvas.LeftProperty, 50.0 + Math.Sin(offset + 7.0 * step) * 50.0);
            C7.SetValue(Canvas.TopProperty, 50 + Math.Cos(offset + 7.0 * step) * 50.0);

            C8.SetValue(Canvas.LeftProperty, 50.0 + Math.Sin(offset + 8.0 * step) * 50.0);
            C8.SetValue(Canvas.TopProperty, 50 + Math.Cos(offset + 8.0 * step) * 50.0);
        }
예제 #2
0
        /// <summary>
        /// Load Event
        /// </summary>
        /// <param name="sender">sender Parameter</param>
        /// <param name="e">Argument Parameter</param>
        private void HandleLoaded(object sender, RoutedEventArgs e)
        {
            const double Step   = Math.PI * 2 / 10.0;
            const double Offset = Math.PI;

            C0.SetValue(Canvas.LeftProperty, 50.0 + (Math.Sin(Offset + (0.0 * Step)) * 50.0));
            C0.SetValue(Canvas.TopProperty, 50 + (Math.Cos(Offset + (0.0 * Step)) * 50.0));
            C1.SetValue(Canvas.LeftProperty, 50.0 + (Math.Sin(Offset + (1.0 * Step)) * 50.0));
            C1.SetValue(Canvas.TopProperty, 50 + (Math.Cos(Offset + (1.0 * Step)) * 50.0));
            C2.SetValue(Canvas.LeftProperty, 50.0 + (Math.Sin(Offset + (2.0 * Step)) * 50.0));
            C2.SetValue(Canvas.TopProperty, 50 + (Math.Cos(Offset + (2.0 * Step)) * 50.0));
            C3.SetValue(Canvas.LeftProperty, 50.0 + (Math.Sin(Offset + (3.0 * Step)) * 50.0));
            C3.SetValue(Canvas.TopProperty, 50 + (Math.Cos(Offset + (3.0 * Step)) * 50.0));
            C4.SetValue(Canvas.LeftProperty, 50.0 + (Math.Sin(Offset + (4.0 * Step)) * 50.0));
            C4.SetValue(Canvas.TopProperty, 50 + (Math.Cos(Offset + (4.0 * Step)) * 50.0));
            C5.SetValue(Canvas.LeftProperty, 50.0 + (Math.Sin(Offset + (5.0 * Step)) * 50.0));
            C5.SetValue(Canvas.TopProperty, 50 + (Math.Cos(Offset + (5.0 * Step)) * 50.0));
            C6.SetValue(Canvas.LeftProperty, 50.0 + (Math.Sin(Offset + (6.0 * Step)) * 50.0));
            C6.SetValue(Canvas.TopProperty, 50 + (Math.Cos(Offset + (6.0 * Step)) * 50.0));
            C7.SetValue(Canvas.LeftProperty, 50.0 + (Math.Sin(Offset + (7.0 * Step)) * 50.0));
            C7.SetValue(Canvas.TopProperty, 50 + (Math.Cos(Offset + (7.0 * Step)) * 50.0));
            C8.SetValue(Canvas.LeftProperty, 50.0 + (Math.Sin(Offset + (8.0 * Step)) * 50.0));
            C8.SetValue(Canvas.TopProperty, 50 + (Math.Cos(Offset + (8.0 * Step)) * 50.0));
        }