Пример #1
0
        /// <summary>
        /// Collor Select Click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ColorSelect_Click(object sender, RoutedEventArgs e)
        {
            // get the textBlock Object
            Button _button = sender as Button;
            int    _sendReciveSelection = (Int32)_button.Resources["SendReciveSelection"];

            // Get the Visual Element
            ContentControl _visualElement = sender as ContentControl;

            // Create an Settings View
            //ColorPicker _colorPicker = new ColorPicker(PointToScreen(Mouse.GetPosition(this)));
            ColorPicker _colorPicker = new ColorPicker(_visualElement.PointToScreen(new Point(0, 0)));

            if (_colorPicker.ShowDialog() == true)
            {
                // Create the Event Arguments
                TelegrammColorEventArgs _args = new TelegrammColorEventArgs();
                _args.Color = _colorPicker.getColor;
                _args.SendReciveSelection = _sendReciveSelection;

                // Update the UI
                setForegroundColor(_args.Color, _args.SendReciveSelection);

                // Set the Event that the User Changed an Input
                telegrammColorChange(_args);
            }
        }
Пример #2
0
 // Invoke the Changed event; called whenever list New Message should be send
 protected virtual void telegrammColorChange(TelegrammColorEventArgs e)
 {
     if (TelegrammColorChange != null)
     {
         TelegrammColorChange(this, e);
     }
 }