« first day (1045 days earlier)      last day (3104 days later) » 

7:59 AM
0
Q: WPF and touch - focus issue

YoavI have a WPF .NET 4.6 application running on a Windows 8.1 tablet and for the last few days I've been struggling to make my app touch friendly to make it work as expected. My main problems are focus related, these affect several controls in my app. for example: Textboxes: sometimes requires a ...

 
 
7 hours later…
2:48 PM
0
Q: A Generic way to create a checkable context menu from a list of enum values

Eric OuelletI want to create a context menu where one of the menuItem would be a submenu with a choice among enum values. I do not want to hard code any of the values from my enum into xaml because I want that any enum value changes would be automtically reflected in the UI without any intervention. I want...

 
 
5 hours later…
7:25 PM
Is anyone able to help with data binding?
 
Sure
What's up?
@JoshMenzel Ping me, I'll be around
 
@LynnCrumbling I am having trouble getting WPF to work with Static Subclasses and properties for 2 way binding
i.e
I want to bind Globals.Data.DataInformation.GlobalCompanyData.CurrentClientVersion (string) to my textbox
GlobalCompanyData is a STATIC instance of DataInformation.CompanyData
 
I would be tempted to just make a ViewModel property that returns that thing, and bind the vm property.
Thoughts on that?
 
I don't know how to do that
lolz
 
Are you using mvvm in your project?
 
7:37 PM
Trying to understand it
I want to implement 2 way binding, INotifyPropertyChanged, etc...
to make my backend and project easier
My model is DataInformation
 
What's the codebehind look like in your view's constructor?
 
Would it be easier to teamviewer it or just pastebin?
 
pastebin works
 
ok
@LynnCrumbling if you are interested: m75-860-152
that's my Model
 
The view's constructor should be something like this:
    public MainWindow()
    {
        vm = new MainViewModel(this);
        this.DataContext = vm;
        InitializeComponent();
   }
What's your ViewModel look like?
 
7:41 PM
that is the backend of AdminCenterWindow.xaml
and then the ViewModel I really am not sure
I was planning on using my Globals class
since majority of my data is either non-instance required or a list of instances from DataInformation
 
Ahh, ok, so it doesn't look like you have a viewmodel at the moment.
 
That's what you'll databind against... properties in the viewmodel.
 
isn't the viewmodel just the data that should be shown?
i.e. Globals?
 
The viewmodal is the engine
It should hold all of the data and do all of the work.
The view should do no work.
 
7:44 PM
Because all the data needs to be loaded and constantly listening for syncronization via websockets
that's what I am trying to do
so essentially, my Globals is the viewmodel
 
It shouldn't be starting threads, executing action code (read: button clicks), and maintaining program state.
 
so then how do I get the view to fire button events and handle changes?
like how do I restructure my program(since I clearly need to)
 
I'd start by making a new class that will be your viewmodel. Instantiate it in the constructor of the view. And set your view's datacontext (dc) to the newly instantiated vm.
I'll work through each step.
Especially button clicks.
Those button_click events go away entirely.
 
umm...can I just do it for this one window(the main window)
or do I need to re-do the entire program
I have an update window and a login window as well
 
Generally, you'll want the entire program to follow that construct. You'll find yourself fighting the pattern otherwise.
But for now, we can just do the main window
 
7:47 PM
okay...
 
That way you'll get a feel for it.
 
okay..would you mind doing teamviewer for this?
 
So, create a viewmodel class.
Yeah, let me go grab it.
I need to reboot to finish an install; let me do that. I'll be back in 3-5.
 
thank you
okay
 
7:54 PM
@LynnCrumbling when you get back, the meeting id is m08-042-023
 
is that an m as the first character? I thought they were all numeric.
 
yh
they all start with m
then a bunch of numbers
it's a meeting, not a remote control session
 
Ahh, ok.
 
yeah
 
teamviewer's coming down
 
7:56 PM
?
 
one sec.
I had to kick off a wix install first.
 
kk
ah ok
 
ok.. team viewer is installed...
here we go..
 
sweet
 

« first day (1045 days earlier)      last day (3104 days later) »