Click here to Skip to main content
14,659,002 members
Home » Discussions » Silverlight / WPF
   

Silverlight / WPF

 
AnswerRe: VB.Net/WPF/XAML "The video does not load via the executable." Pin
Pete O'Hanlon19-Dec-17 19:33
subeditorPete O'Hanlon19-Dec-17 19:33 
GeneralRe: VB.Net/WPF/XAML "The video does not load via the executable." Pin
Member 1358548219-Dec-17 22:42
MemberMember 1358548219-Dec-17 22:42 
QuestionComboBox ItemTemplate Pin
Kevin Marois16-Dec-17 8:44
professionalKevin Marois16-Dec-17 8:44 
AnswerRe: ComboBox ItemTemplate Pin
Gerry Schmitz17-Dec-17 7:18
mveGerry Schmitz17-Dec-17 7:18 
GeneralRe: ComboBox ItemTemplate Pin
Kevin Marois17-Dec-17 8:14
professionalKevin Marois17-Dec-17 8:14 
GeneralRe: ComboBox ItemTemplate Pin
Gerry Schmitz17-Dec-17 8:30
mveGerry Schmitz17-Dec-17 8:30 
QuestionUsing Rx with MVVM pattern Pin
Kenneth Haugland16-Dec-17 0:40
professionalKenneth Haugland16-Dec-17 0:40 
AnswerRe: Using Rx with MVVM pattern Pin
Kenneth Haugland16-Dec-17 3:16
professionalKenneth Haugland16-Dec-17 3:16 
I gave up on the Rx part and did my own EventCommand:
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interactivity;

namespace WpfSimpleReflectionAssistant
{
    //Code from:
    //https://social.msdn.microsoft.com/Forums/silverlight/en-US/5cd586e7-640f-447b-9040-e9270173abf7/passing-drop-event-data-in-a-command-parameter-using-mvvm-and-the-interactivity-framework?forum=silverlightmvvm
    public sealed class EventCommand : TriggerAction<DependencyObject>
    {

        public static readonly DependencyProperty CommandParameterProperty =
            DependencyProperty.Register("CommandParameter", typeof(object), typeof(EventCommand), null);


        public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(
            "Command", typeof(ICommand), typeof(EventCommand), null);


        public static readonly DependencyProperty InvokeParameterProperty = DependencyProperty.Register(
            "InvokeParameter", typeof(object), typeof(EventCommand), null);

        private string commandName;

        public object InvokeParameter
        {
            get
            {
                return this.GetValue(InvokeParameterProperty);
            }
            set
            {
                this.SetValue(InvokeParameterProperty, value);
            }
        }


        public ICommand Command
        {
            get
            {
                return (ICommand)this.GetValue(CommandProperty);
            }
            set
            {
                this.SetValue(CommandProperty, value);
            }
        }

        public string CommandName
        {
            get
            {
                return this.commandName;
            }
            set
            {
                if (this.CommandName != value)
                {
                    this.commandName = value;
                }
            }
        }

        public object CommandParameter
        {
            get
            {
                return this.GetValue(CommandParameterProperty);
            }

            set
            {
                this.SetValue(CommandParameterProperty, value);
            }
        }

        public object Sender { get; set; }

        protected override void Invoke(object parameter)
        {
            this.InvokeParameter = parameter;
            if (this.AssociatedObject != null)
            {
                ICommand command = this.Command;
                if ((command != null) && command.CanExecute(this.CommandParameter))
                {
                    if (this.CommandParameter.GetType() == typeof(Canvas))
                    {
                        Canvas myCanvas = (Canvas)this.CommandParameter;
                        Point pass = Mouse.GetPosition(myCanvas);
                        command.Execute(pass);
                    }
                    else
                        command.Execute(this.CommandParameter);
                }
            }
        }
    }
}


This would probably be better as an Attached property instead, but I didn't bother just now. But surely there has to be a better way or?
QuestionCustomize Scrollbar in wpf Pin
Member 105139666-Dec-17 22:22
MemberMember 105139666-Dec-17 22:22 
QuestionRe: Customize Scrollbar in wpf Pin
Richard MacCutchan6-Dec-17 22:24
mveRichard MacCutchan6-Dec-17 22:24 
AnswerRe: Customize Scrollbar in wpf Pin
Member 105139666-Dec-17 23:28
MemberMember 105139666-Dec-17 23:28 
GeneralRe: Customize Scrollbar in wpf Pin
Richard MacCutchan6-Dec-17 23:48
mveRichard MacCutchan6-Dec-17 23:48 
AnswerRe: Customize Scrollbar in wpf Pin
Richard Deeming7-Dec-17 8:30
mveRichard Deeming7-Dec-17 8:30 
GeneralIterating the cells of a gridview Pin
Member 83993636-Dec-17 12:49
MemberMember 83993636-Dec-17 12:49 
GeneralRe: Iterating the cells of a gridview Pin
Gerry Schmitz6-Dec-17 16:53
mveGerry Schmitz6-Dec-17 16:53 
GeneralRe: Iterating the cells of a gridview Pin
Member 83993636-Dec-17 17:14
MemberMember 83993636-Dec-17 17:14 
GeneralRe: Iterating the cells of a gridview Pin
Gerry Schmitz6-Dec-17 17:52
mveGerry Schmitz6-Dec-17 17:52 
GeneralRe: Iterating the cells of a gridview Pin
Member 83993636-Dec-17 18:01
MemberMember 83993636-Dec-17 18:01 
GeneralRe: Iterating the cells of a gridview Pin
Gerry Schmitz6-Dec-17 18:13
mveGerry Schmitz6-Dec-17 18:13 
QuestionHow To Create This UI Pin
Kevin Marois1-Dec-17 5:17
professionalKevin Marois1-Dec-17 5:17 
AnswerRe: How To Create This UI Pin
Mycroft Holmes2-Dec-17 12:38
professionalMycroft Holmes2-Dec-17 12:38 
QuestionWPF TreeView - Some Nodes Not Showing Pin
Kevin Marois30-Nov-17 11:56
professionalKevin Marois30-Nov-17 11:56 
AnswerRe: WPF TreeView - Some Nodes Not Showing Pin
Mycroft Holmes30-Nov-17 12:14
professionalMycroft Holmes30-Nov-17 12:14 
GeneralRe: WPF TreeView - Some Nodes Not Showing Pin
Kevin Marois30-Nov-17 12:15
professionalKevin Marois30-Nov-17 12:15 
GeneralRe: WPF TreeView - Some Nodes Not Showing Pin
Mycroft Holmes30-Nov-17 12:41
professionalMycroft Holmes30-Nov-17 12:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.