« first day (916 days earlier)      last day (3233 days later) » 
00:00 - 19:0019:00 - 00:00

12:00 AM
or a view model
 
I set them up using propdp-tab-tab, but the compiler is complaining that the property is not found in the type of the usercontrol
Any idea what I'm not doing there that I need to do?
I'm trying to access the properties like so:
<local:CalculatorButton
Grid.Row="10"
Grid.Column="2"
Command="{Binding Button0_ClickCommand}"
WhiteString="White String"
OrangeString="Orange String"
BlueString="Blue String"
/>
The 'Command' dependency property worked fine, strangely enough
 
theres a few elements that have commands
they arent necessarily click events
imo you should be putting the command directly on the button
not on the control that contains the button
 
Right, but before I set up the depprop, it was complaining that the Command property didn't exist
I have different commands for each of the dozens of buttons on the page. How would I do that if I want to use the same usercontrol for each of the dozens of buttons?
 
view models
 
The commands are defined on the view model for the page that contains the dozens of buttons
 
12:03 AM
but not every button uses every command
im sure you could group your commands into types
 
Right, each uses one, and they're never (or almost never) re-used
 
so you could have a view model for your 1-9 buttons
that all implement the same command
and you could hav another view model your * button
that implements multiplication cmd
 
Can't do that, unfortunately, as each of those buttons also have two different functions they could run, depending on the mode
 
so what
implement each command into the view model
and use a mode to determine whcih one to call
 
So they can't all call the same command
 
12:05 AM
they can call a command that checks a flag and calls the right function
 
Right, that's what they're doing right now
But there are 9 different commands
or 10
each of which muxes to 2-3 different other functions
 
i am not seeing an issue
each view model can implement all the possible functions a specific button type could acll
then the button can call a command on the view model
and that command can call the correct functino
 
Before we go down the path of refactoring the entire organization of the codebase, any guesses as to why the dependency properties that are clearly in the user control are not being seen/noticed/ack'd by the compiler? They are all public
Let's say that the buttons don't do anything when pressed, so the Command question is for another day
 
i think i've used DP's like twice
i am pure vm
 
Aha, gotcha. @BradleyDotNET has a lot of experience with them, I wonder if he has any ideas on the topic
So you make a different usercontrol for each vm, or something like that?
 
12:09 AM
im guessing your buttons have types
1-9 is a type
 
Or a different vm for each control on the page, regardless of whether it's cusom or not
 
* is a type
 
Let's assume that's not true
 
/ is a type
well i dunno then. thats how i would do it. then you could have one user control that represents 1-9
and so on
 
Each button is structurally similar. They each have a 'white' side, an 'orange' side, and a 'blue' side
So I can use the same usercontrol for each button on the page
 
12:10 AM
ok sure
thats easy
 
And maybe a different VM for each of them
 
exactly
on your form load you can do
button1.datacontext = new Button1Vm(Color red, FontSize 12)
 
I have no real objection to doing that, except that's a task for another day
 
then you have access to your view models at run time and can toggle properties without ever referencing the cotnrol
 
(it'll probably take multiple days to actually implement)
And then I went back over to my Main.xaml and the errors went away. Thanks, lookahead error reporting!
 
12:21 AM
If you guys have experience with LC3, can you guys take a look at this?superuser.com/questions/904947/…
 
12:44 AM
???
this is the wpf channel
 
Sorry i didn't see a chat channel for this material
 
 
7 hours later…
8:11 AM
Moring!
 
8:24 AM
Does anyone use ReSharper?
@Sisyphe didn't you use it?
 
 
2 hours later…
10:38 AM
Sup my friendly home dawgs
@Markus I do!
 
Do you have a lot of I/O Others done by your Visual Studio?
Task manager; under processes click view -> select columns... and select I/O Other and see if VS is going wild on the that property. Then ping me with the result?
 
10:53 AM
@Markus what would you consider "wild"?
Its counting up about 100kb/s
Maybe less than that actually
 
11:06 AM
I don't think that's bytes...
what is your value? I have like 3 731 636
oh ok, I hadn't selected bytes...
my I have 64 352 192 Other bytes
71 040 412 now
oh sorry that last was an other.. :)
 
11:28 AM
It's just that, that's a lot more than my colleague without ReSharper...
 
12:13 PM
@Markus sorry went to lunch, mines at 1,064,568K
 
12:26 PM
0
Q: Show Border on avalonEdit:TextEditor

Stewart_RI am trying to get a border to show around an avalonEdit 'box' in a Wpf control but can't seem to make it happen. I added BorderBrush="Black" BorderThickness="2" but clearly I am missing something. I've googled but, despite my endeavors, I cannot find anything - I suspect I may not know the cor...

 
 
1 hour later…
1:34 PM
hey hey hey
Can my program write / read from the registry on a win7 machine without being admin?
I'm using Microsift.Win32.Registry.GetValue
 
2:24 PM
posted on April 23, 2015 by ericlippert

Occasionally I’m asked to review code that has a lot of repetition in it. Like, for instance, someone is writing a function memoizer: static Func<A, R> Memoize<A, R>(this Func<A, R> function) { var cache = new Dictionary<A, R>(); return argument … Continue reading →

 
2:38 PM
@Markus If it has the correct rights to the section of the registry that you are attempting to modify. Which hive are you working with?
@Markus Reading isn't usually a problem, but there are sections that will be restricted; for example, even if a different user's hive is loaded on HKU, you won't be able to read it.
Generally, anything under HKCU, HKLM, and HCR will always be readable.
And... generally anything under HKCU will always be writable.
As a non-admin, if you don't explicitly set permissions at installtime, HKLM items will not be writable.
 
3:32 PM
@KyleHumfeld Sorry I missed you last night, if you still have questions about DPs let me know
 
Does it break MVVM if you store the control inside of a ViewModel?
 
Kind of
Just do so with care
And depending on your use case, there can be a better way :)
by storing a view model and using the view as a data template for that view model type
 
In all honesty I think ive gotten myself into a design hole
But in this instance. I basically need access to the control (for undo-redo commands). On load I attach this control, to the viewmodel
So the viewmodel can invoke them
 
Yeah, that is bad
because now your view model needs a strong reference to the view
 
Yeah but why is that bad?
 
3:46 PM
Over-knowledge of the layers
and say you want to test the VM, you need a whole instance of a UI object
 
Are you saying that view models should be applied to other Views?
(of different control types)
should = should be able to be
 
Yes, in theory
 
Ill bet that happens in very few complex cases :)
 
Granted, we rarely do so in practice, but the pattern suggests that it should be possible :)
 
yes
Its sort of like....
Oh, View doesn't know anything about ViewModel
 
3:49 PM
And in all reality, its just not a good dependency to have
 
but it implicitly implies they need to know about each other to function
 
No, View knows plenty about the view model
and view models know a lot about models
but knowledge doesn't go the other way
models don't know about views or view models
 
Yeah
Let me ask you this
 
and view models don't know about views
 
Your business Model
You have multiple ViewModels, modifying the Model right?
 
3:50 PM
Usually
 
What handles Undo/Redo?
 
Probably the view model
In theory, every action taken would be a command
 
Yeah
 
and you would store a history every time one was invoked
 
Yeah ive got that
 
3:52 PM
and on the "Undo" command, you would tell the last thing in the history to undo
 
Yes yes
But
 
which would obviously have enough data to reset the VM state
 
ViewModelA -> modifies Model
How do other ViewModelsB/C/D know?
I guess binding
 
Not binding
 
O_o? PropertyUpdates surely?
 
3:53 PM
When the model has a chance of changing "out from under" a VM, I have it fire an event to notify that its been changed
Then the view models pick up that event, modify their state, and the associated views pick up the state via bindings
but view models usually aren't binding to models
binding is pretty much a UI thing
 
sorry
Yes you are right
Yes, events would be fired
"Hey the model updated!"
"Ok, ill update myv iew model"
 
Right
 
View updates bceause the view model has
Yeah, So my problem (sounds crazy)
Is that my Undo/Redo is sort of in the Model
Which causes all sorts of awkward situations
 
Yeah, thats a bit odd
 
You tell the Model to Undo its last action. Then All the ViewModels have to know about this
 
3:56 PM
same principles would seem to apply though
 
The problem arises when The ViewModels handle the models changes differently
This also means theres no concept of Context
Since the model is 1 context
So model needs to know about context switches
Lol, yes. I need to rethink all of this
 
4:14 PM
sounds like it...
 
@BradleyDotNET did you roll your own undo/redo ?
 
are you undoing each individual action
like a single key press
or just reverting a VM back to original state
 
@Asheh Have yet to do an app that needed it
but I can imagine a design for one
 
anyone ever seen/used an alphabet sorter control
something that looks nice
 
4:43 PM
my mom. she sorts the magnetic letters on the fridge really well for my niece
 
rofl
 
hi
anybody that ever used Modern.UI?
 
5:00 PM
Somebody had recommended it...
I don't remember who though
 
mav or reed i think?
used it. idk about recommend
 
It might have been Mav
 
sounds right. though i think reed has used everything
 
i use mahapps.metro, same kind of thing
 
Morning all!
 
5:04 PM
good morning Kyle
 
Yesterday I asked some questions about styling elements, and y'all made the suggestion to make a UserControl and put the Button I'm trying to style in there so I can focus on that part of it without all the rest of the xaml markup.
Great suggestion! And I did just that. But I can't seem to figure out why it's behaving the way it's behaving. I stripped down the example to the bare essentials and posted the details here: stackoverflow.com/questions/29811723/…
 
Since I started to use modern.ui, all my views bind to MainViewmodel instead of their self VMs
 
If someone has a chance, I'd be grateful if they could glace over there and tell me what I'm doing wrong. I figure it's got to be something simple, some attribute I don't know about that I'm not setting correctly
As for Dependency Properties, the real UserElement I'm trying to create has more complication involved, namely the <Button> has three <TextBlock> elements in it that are each Named (tried Binding, too) after the DPs I set up
 
hey guys, I have a problem here today that I cant seem to figure out
 
Might have something to do with "Stretch" not doing what you might hope when applied to a button
 
5:09 PM
my designer keeps crashing with an NPE:

at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CallSynchronizationMode syncMode, WaitHandle timeoutSignal)
 
But when I try to use the UserControl, the compiler squawks and says that the UserControl doesn't have that property
 
I disabled my view model as the data context for the form, didn't fix anything
got no clue whats wrong
 
@MarkW Yuck
I have no clue what any of those are
does it run?
 
yeah
 
Gotcha @BradleyDotNET, is there another attribute or setting that I should be using rather than "Stretch"?
 
5:10 PM
@KyleHumfeld Could you show the UserControl def?
Button doesn't usually stretch to fill its container
googling
 
Okay, uber hack, you could try using DockPanel if WinRT supports that
 
Right, I've definitely seen that Button doesn't generally stretch... but I kinda need it to, and I was hoping that with a UserControl, I could specify the formatting, styling, and composition of the UI for the UserControl (half the point of using a UC, right?)
 
Not really
 
I don't believe that DockPanel is part of WinRT
 
5:11 PM
all that can be done with templates
 
I did try that as well, but with similar results
 
Oh, I'm sure the results would be similar :)
 
Can't you just use
<Button...>
    <TextBlock Text="Stuff" />
</Button>
(and not use a usercontrol at all)
 
My actual non-cribbed-down UC has a Template in it, and it does exactly what the version I posted does, namely, not making the button bigger
 
what kind of app are you working in
i know its a store app, but theres lots of diff kinds
universal?
 
5:13 PM
@NETscape I have that in the 'real' UC, but it doesn't make the Button bigger than the aggregate size of the TextBlocks I put inside of it
 
Technically there are two different kinds :)
 
@Julien yes, universal, though at the moment I'm working on the UI for the Phone side
 
i just want to mimc what kyle is working in
 
And C# xaml is the language
 
so you are in xaml file in a phone 8.1 project
 
5:14 PM
Yes
 
lol
 
Yeah, maybe I can try some stuff tonight
 
well my results are different then yours
 
since I'm not on Win8 here
 
0
Q: Cal.Message.Attach - No target found for method

Kerem ZamanI designed an interface in WPF with Caliburn.Micro. I have customized radiobuttons which are triggered a method by cal:Message.Attach property when they're checked. But when I check one of the radiobuttons having this property, I get the error of: No target found for method My FarKornaView.xaml:

 
5:15 PM
hehe that's a good thing Bradley
 
Interesting, @Julien! Let me take a look at that screenshot and see what's different
That looks like a direct copy/paste from my post, is that correct?
 
yup
 
Oh holy heck
 
you probably have some global styling happening
 
5:18 PM
Okay, that might be. I'll check my other templates that define styles and see if the culprit might be there. Thanks for the sanity check! =)
 
you should try it in a new project
to exclude existing code
 
Yeah, my ResourceDictionary does seem to be fouling up the styling on this UC. When I change the Style def there from Button to AppBarButton, the UC definitely exhibits different behavior
 
what style are you applying
 
Awesome, thanks so much for getting me back into a place where I can try [something] and have [anything] happen
Looks like I had MaxHeight and MaxWidth attributes set, which would definitely be a big problem.
I can copy/paste the whole def of the style if you want
 
gist it
 
5:21 PM
not familiar with gist
 
(except as a noun)
 
Service provided by github to make code sharing easier :)
@MarkW I wouldn't mind being on Win8 here, at least it wouldn't take 10 minutes for my machine to boot
 
not it would just take 5 minutes to find aything
:P
 
5:23 PM
Meh, once you get used to it, I'm just as fast
if not a little faster
since the OS in general is a bit faster/more responsive
 
meh I hate it
cant stand the UI
 
I actually really like Win8.1. I never go to the Start screen, and it's got a few nice features that make me prefer it to Win7. Runs more responsively too, anecdotally
 
stupid ass tiles....
 
Yeah, if you don't have a touch screen, just avoid the tiles screen.
You can boot right to desktop, after all
 
The tiles aren't that bad :)
 
5:25 PM
boot to desktop and install classic shell
is best bro
 
if you have a touch screen maybe...
but, I don't wanna touch my screen
 
You guys should like Win 10 then though
 
I want to use a mouse
 
They're not that bad, but not that good, either, and they tend to launch full-screen apps which isn't that good if you have a big display
 
I look forward to a release candidate I can play with
 
5:25 PM
Yeah, I'm really looking forward to that. I might actually use a WinStore app with Win10
 
I use win 8.1 both with a mouse and with touch, and the start screen works just fine for me
Even the full screen apps can be snapped
 
I find that while it works just fine, there's no compelling reason to ever use it
 
I like it better than 10 million shortcuts on my desktop
but then, I'm a clean desktop kind of person
 
i have desktop icons turned off
 
I never really see my desktop, so it's not clean but also not bothersome
 
5:26 PM
I put the address bar on my task bar
so I can use the environmental vars
to launch whatever I use frequently
 
BTW, may I just say that Win8 and Win7 both beat the pants off OS X in terms of usability, with the sole exception that if you're good at UNIX command-line stuff and you need UNIX command-line stuff, the command line on OS X is better
 
lol, I don't think I would like that
 
But the GUI implementation is ... just behind
 
just use cygwin :)
 
well I just type in like devenv and it opens my ide
or notepad to launch notepad
its just like having cmd on my desktop at all times
 
5:28 PM
I use Win-Q and type in whatever I want to launch and it does so. Win8 is really good for that
 
wonders why someone would want cmd open all the time
 
because all the clicky sucks
 
If you're a ninja at the command line, you use the command line =)
 
I prefer to type once and hit enter
 
I'll pass, but I'm glad you found a solution you like!
 
5:29 PM
:D
 
Cool number of C# questions right now: 783,783.
of course, that lasted all of 30 seconds
 
Say, is there something like FireBug for the xaml designer that lets you inspect an element and see where it's getting its styling information from?
As it can be affected by various style defs in various files
 
snoop
 
Aha, so that's what that does
 
Among other awesome things, yes
 
5:32 PM
wish I had a designer :(
 
Supposedly a snoop-like feature is going to be added to vanilla WPF soon
 
cant get it to freaking work
 
something is supposed to be in VS 2015
 
I literally added a case statement to a switch in my vm
now nothing works
 
haven't got a chance to try it yet though
@MarkW I assume you have restarted?
 
5:33 PM
yep
multiple times
added and removed references
etc
made my datacontext NOT my vm
thinking it might be something broken in there
but the app launches and runs fine
it just wont load in the designer
 
open the files manually
and remove code
for eg strip your xaml empty
 
hi guys I am working on an application and need some guidance
 
:/ I thought that might do it Julien
my XAML is just an empty <Window> tag
still crashes with an NPE
 
what about namespaces
 
<Window x:Class="AutoPicker.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="555" Width="924">

</Window>
that's the complete xaml
 
5:41 PM
what happens when you make a new window
 
crashes
same exception
 
what happens when you make a new project
and then make a new window
 
lol ill try
 
preferrably a new project inside a new solution
just in case
 
yeah
restarting the IDE too
 
5:43 PM
@savi care to provide any details?
 
step 1) write code step 2) run app
 
created a whole new WPF project, and the IDE built the basic window for me... and it loads fine
must be something in the project
 
yup
 
My application is completely based on MVVM architecture, I have a MainWindow which has its own View, ViewModel. I have 2 other views, View1, VM1 and View2 and VM2. Now I have a requirement where I need to call a MainWindow function from View1 to open View2
how do I communicate this?
from View1?
 
events, usually
create an event and have view 2 listen for it
then have view 1 raise it whenever needed
 
5:46 PM
^
We really need a "+1 but not star" feature in chat...
 
oh yeah looks like events work in my case
 
ill take a star :D
 
let me try!!
@Julien you get a gold Star
 
Hey if one of you guys wants to answer the question I posted earlier (now that we know the answer), I'll upvote and mark as correct. If not, I'll answer it myself. But you definitely earned the rep if you want it. =)
 
I remembered to join chat! I don't even have an active question.
 
5:50 PM
Puts you a step ahead of me @Billdr =)
 
@Billdr remember my db issues from yesterday? figured it out, totally ridiculous
 
What was the problem, @Julien?
What's the question, @KyleHumfeld?
 
contexts
 
It had to do with my post from last night: stackoverflow.com/questions/29811723/…
 
1
A: Struggling with EF CodeFirst 1 to Many relationship

user1384848I think what you really want is a many-to-many relationship: One movie can have many categories and also one category can belong to many movies. So the Category class needs a public virtual ICollection<Movie> Movies {get; set; } property. Your Movie class could look like this: public class Mov...

 
5:51 PM
if it's UI stack stuff don't tell me, I can't help you.
 
dont know how to link directly to my answer
 
These smart folks helped me figure out what's happening there for the most part, now I can tinker a bit more and try to get more of the stuff I really want to work, to work
 
ah. the share button. der
 
ttyl all, gotta step out for a bit
 
I found it.
I don't understand why that code works when a single use of context does not. I'd like to have the time to think deeply about it, but I'm already going to be working all weekend.
 
5:53 PM
i dont know either
 
I think julien gets the answer on that one :)
 
i think its really lame that you cant specify a spacing between items in an items control
seems like it should be something super basic
 
You can apply a style to the containers
 
not the same thing
if you have one element it sucks, and your first and last element will always be wrong
 
6:16 PM
so... it was a project in the solution written in VB.net
when I remove that project from the solution, the designer loads
 
damn VB!
 
lol
yep
you know whats really nice?
the PreviewTextInput event in WPF
for validating user input
 
does anyone here use prism
i am reading about events in wpf mvvm
and most examples use prism framework
 
6:45 PM
Well, you know how I feel about frameworks :)
 
00:00 - 19:0019:00 - 00:00

« first day (916 days earlier)      last day (3233 days later) »