« first day (950 days earlier)      last day (3199 days later) » 

12:00 AM
<Page.Resources>
        <DataTemplate DataType="{x:Type vms:ViewSubjectGradeViewModel}">
        <local:ViewSubjectGradePage />
    </DataTemplate>
    </Page.Resources>
tells me, "The member DataType" is not recognized or is not accessible
*tried
but get the above error, on DataType anyone know the alternative to DataType in Windows Universal? Or is this the wrong approach?
 
You may need to use a selector, looks like the implicit keys are no good: msdn.microsoft.com/en-us/library/…
 
12:30 AM
okay I'll have a gander at that in the morning, 2am zzz thanks
 
 
13 hours later…
1:15 PM
Hi guys ! please help me with my problem .
Assuming I have View1 and View2 in my WPF project. Now from WPF View1 , I want to go to View2 via Click event . How will I do that? I already tried stkContent but doesnt work.
any reference ?
Thanks guys!
 
1:29 PM
how would I clear a stack panel
 
1:49 PM
You dont
you have to use DataTemplate with new TargetType of View2 and set that as Content's DataContext
if all of that sounds greek, you need to learn about MVVM pattern and how to implement it
 
2:01 PM
posted on May 27, 2015 by ericlippert

The nice people at the programmerchat section of reddit have asked me to do an Ask Me Anything, and of course I am happy to do so. Thanks to reddit for the invitation. For those of you unfamiliar with the … Continue reading →

 
2:50 PM
good read for people designing inheritance chains
For the TL;DR people, excerpt from above:
In summary what constitutes a Liskov Substitution Principle violation?

Throwing Not Implemented Exceptions.
Making use of Method Hiding (the New keyword on virtual methods)
Making use of array covariance on public return types
Violating the implied or documented behavior of a base class (returning null instead of empty lists for example)
 
 
1 hour later…
4:07 PM
I like the square violation's example on wikipedia
 
4:18 PM
I just ran into the need to have an ObservableDictionary and found this to be a recommended solution:
as for square violation, I haven't seen it but sounds like another good example
 
oi
 
hi
trying to implement OAuth using the WebAuthenticationBroker, but getting a "Url not allowed error" , oh the joys..
 
Ey
@BrianJ you probably missed out AllowedRedirectUrl thingy in your OAuth client setup
the registration bit with server
(I'm assuming you're in Implicit flow)
 
you mean in the app setup on Facebook dev or my code?
0
Q: Facebook WebAuthenticationBroker, "Given URL is not allowed by the app config"

Brian JI'm following this tutorial which uses the WebAuthenticationBroker to provide authentication on Windows Phone 8.1 apps. But when I test the app, I get an error relating to the URL shown below. I've tried both debugging solutions outlined in this question, to no avail.Also my app ID is correct in...

posted a question showing the specifics
 
Maverik Aw, but its fun to throw NotImplementedException. Makes people later so happy with you :)
 
4:30 PM
I did set the Valid OAuth redirect URI's to Facebook.com as suggested in other solutions, if that's what you mean? @Maverik
 
Ah no i meant in general that's the problem.
I'm sure if there are questions on facebook related error, there must be solutions to it as well since a ton of peeps use that stuff
I'm having similar joys in a custom IdentityServer
 
yeah could be something small
custom identity server sounds like a lot more painn
 
4:45 PM
@BrianJ did you setup your app config correctly?
 
hello
I was wondering if any of you have some time to talk with me about a value converter I implemented, and maybe give me some advice about making it a little easier to use
 
:D thanks bradley
so a quick run through.... I have an app that will be used to read and write settings to these devices... there are dozens of values, everything from SSID, to baud rate. Each setting has its own control someplace in the app. I need to have the ability to provide visual feedback that a value has been changed by the user.
To do this I wrote a value converter called BooleanToBrushConverter that converter is designed to be used in conjunction with a Boolean property that the Background or Foreground of a control is bound to. It works perfectly, and even accepts parameters for the colors to use defined in the markup
the thing is, the way I have it now, for every single control that holds user values I have to implement a Boolean property
and there are lots
I was wondering if maybe you have done something similar and maybe have a sneaky way of overloading the function of a single property... like using a Dictionary or something to make that a bit less to implement across the application
 
5:01 PM
Can you adjust your VM to actually use a class for the value instead of just a primitive?
ie: have something that holds the value + boolean for each property
 
not sure I follow, if youre talking to me Reed
 
I think he is
Its a good idea
 
so like... bind the value of the control to SomeProperty.SomeObjectField, and the color to SomeProperty.SomeOtherField?
and use the same value converter I have
 
yep
and/or make a custom usercontrol that does both for you ;)
that's how we have a huge portion of our WPF app structured
 
rubs chin
myes... I like it
 
5:06 PM
it's a bit of work to "wrap" controls, but then it works everywhere
so if you're doing it in a lot of places, it works very well
and the nice thing is that you only end up needing to change one set of templates to have it "fix" a visual everywhere in your app
instead of changing it all throughout the app
 
you think a simple generic poco with value and changed properties?
for the type on the properties
 
if you have a control that has specialized operations, you make your life way easier by giving it its own backing class
and/or custom user control
 
@BradleyDotNET by app config, do you mean in VS, the FB dash, or the Win Dev dash?
 
I've never done OpenAuth
I think that was NETScape
 
oh sorry it was yeah
@NETscape
 
5:30 PM
so whats wrong with this:

<ComboBox Margin="3" ItemsSource="{Binding Path=NetworkModes}" SelectedItem="{Binding Path=SelectedNetworkMode.Value}" Width="200" Background="{Binding Path=SelectedNetworkMode.Changed, Converter={StaticResource BooleanToBrushConverter}}">
where SelectedNetworkMode is a type with properties Value and Changed
it doesn't invoke the Setter in my VM for the property anymore
that seems wrong to me anyway
maybe I implement INPC in the ValueField object (the type of SelectedNetworkMode)
well I figured out that is the case
now my issue is the damn enums
cant make the class generic because I cant use the == operator... so I tried a where T : class in the class declaration, but I cant put enums in it
arg
C# enums are abysmal
lol
:D in case anyone wonders.... this works:
 public class ValueField<T> : INotifyPropertyChanged
    {
        private T OriginalVal;
        private T _Value;
        public T Value
        {
            get
            {
                return _Value;
            }
            set
            {
                if (OriginalVal == null) OriginalVal = value;
                _Value = value;
                if (_Value.GetType().IsValueType)
                {
                    Changed = !_Value.Equals(OriginalVal);
                }
                else
 
5:58 PM
You should be ablet o use _Value.Equals for both - no need for the IsValueType stuff
 
but .Equals on reference types compares references no?
I only care about value equality
not reference
 
== on refernce types is almost always implemented via Equals
 
man the MSDN doc is misleading
•If the current instance is a reference type, the Equals(Object) method tests for reference equality, and a call to the Equals(Object) method is equivalent to a call to the ReferenceEquals method
also this way is much nicer
thanks again Reed
 
@MarkW it's actually pretty accurate if you've ever implemented IEquatable<T>
default implementation of Equals comes from Object.Equals which internally calls Object.ReferenceEquals
 
idk it says "equivalent to a call to ReferenceEquals" and reed implies above that .Equals compares values
yeah so.... now im even more confused
 
6:11 PM
it is equal in default implementation :)
 
lol yeah im not removing that code then
cuz idk who may or may not have f'ed with the equals
 
you're generally supposed to implement your own Equals where your equality matters to you beyond basic reference check
 
and I definitely don't want it comparing references
 
Why not explicit ReferenceEquals(a, b) if that is what you want?
reads good imo
 
cos others may not know ReferenceEquals is something that comes from Object? much like people don't seem to know Object.Equals is what really powers == under the hood generally :)
(and thus == is really powered by Object.ReferenceEquals under default implementation)
 
6:13 PM
im the first to admit that I don't know much about the .equals spec in C#
 
== does ReferenceEquals if not overloaded no?
 
its different than java
 
it does Johan
Mark .. lookup IEquatable<T>
 
all I know is that when two string values are equal, but the references are not, I need to get the value true
 
its a basic interface and even if you dont implement it, you should be aware of its existence and use
@MarkW that's exactly what IEquatable is for!
fortunately for you, string.Equals already does that for you
 
6:14 PM
I see
 
or does it! (i think it does, but i'm confused myself)
 
lol
 
no i think i'm BSing!
 
I think I get ya now
== invokes .Equals
 
regardless, IEquatable<T> is what you want
 
6:15 PM
strings imp compares values
 
yea
and don't be tempted to do .GetHashCode equality - that's the wrong way to implement equality
 
see its completely backwards in java
or in C# depending on your perspective
== compares references
100% of the time
value comparisons must be made via the equals method
nice and clear
you see == is a reference comparison
 
@MarkW You probably should just use EqualityComparerer<T>.Default.Equals
 
again, default implementation does that exact thing 100% of the time
 
that's how most things handle it in the BCL
 
6:17 PM
but even in java, if you override operators, you won't get default java behaviour
 
no, but only while using the .Equals method
== symantics are immutable (might be wrong on that cuz I don't know if you can override the operators in java)
 
I think i've confused you more than i've helped. Reboot and go back to last state :P
 
but for the most part I expect the imp of a method to vary from one type to the next
I don't expect my operators to suddenly change what they mean
depending on my types
 
just ignore what i've said .. listen to reed :)
 
lol
Ill just go get some crayons
sounds like more fun anyway
 
6:18 PM
:D
all I'm saying is, when you don't like default reference equality and you want framework to consider something else for equality - you can make it do that
when you need that kinda thing, you can look up IEquatable<T> - until then, feel free to ignore this :)
Reeds answer is as usual the correct answer
 
I will surely read about it
 
 
1 hour later…
7:29 PM
hi
how to access a Grid or Stack Panel with Name x:Name = "SharePanel" inside a data template for Pivot ItemSource Programatically
 
7:41 PM
errr... don't
 
you aren't going to be able to refer to elements inside a data template by name, at least not easily
and if you find yourself needing to do so, your design probably needs reworking
 
^^ definitely needs reworking
 
i have pivot
with data
generated with pivotitem datatemplate
datatemplate contains a stackpanel called SharePanel
When the app run, I need the SharePanel generated with current index
aby way?
 
why do you need the sharepanel
 
Use AlternationIndex
 
7:52 PM
I want the SharePanel converted to bitmap and share
 
though it's buggy if you have virtualization
 
@ReedCopsey can u pls explain how to use AlternationIndex?
 
10
A: WPF ItemsControl the current ListItem Index in the ItemsSource

RachelI asked the same thing a while ago here There isn't a built in Index property, but you can set the AlternationCount of your ItemsControl to something higher than your item count, and bind to the AlternationIndex <TextBlock Text="{Binding Path=(ItemsControl.AlternationIndex), RelativeS...

though, be aware it can be buggy ;)
but in general, it'll work
 
IIRC that doesn't work in Windows store though
 
i don't get what this accomplishes. it would get you the index of the currently selected pivot item?
 
8:04 PM
You have to use a different trick, can't remember exactly what at the moment :(
 
The only trick to seem work is transferring data to other page
the way I did last time
@BradleyDotNET I managed to get whole data to image using StackPanel by the way
 
8:21 PM
cool
 
Just was trying to remove the extra page
 
 
1 hour later…
9:27 PM
Nicer with explicit self answer than question updated with answer imo
 
for sure
 
@BradleyDotNET What is your profession? What you do for living?
 
10:32 PM
sounds like he's a software engineer to me.
probably Senior
 
10:55 PM
@AbdulMuhaymin I am a software engineer
senior in title, not sure if its actually deserved or not :)
small company, they hand out titles like candy
@NETscape I appreciate the compliment though :)
 
well i think you've got a good handle on .NET stack, for the most part. probably not your only skill set. you did say you were on job sites deploying and what not. i wouldn't want to tell a casino client that we were going to bring in just an ordinary Software Engineer to help... instead, WE ARE GOING TO BRING IN A SENIOR SOFTWARE ENGINEER!
 
haha
 
I've been doing this for 4 years, so the recognition is nice
but when there are only 2 regular software engineers here, the title just doesn't feel as awesome
and 5 engineers total
That being said, I do get to avoid the product installs, so they must think something of my programming ability :)
Haven't had to go to Macau (yet) :)
 
11:08 PM
yeah. I wish I was touching more NET technologies, but its hard to do when you can't get away from legacy software that has to be maintained
 
All of our "legacy" software is .NET :)
and we get a fair bit of latitude to rewrite/redesign pieces when they get too unweildy
 
well i can't finish my project because so much time is spent doing other things unrelated to it.
 
Now we definitely have that problem :)
 
well at least you have 3 SE's in the office... i'm unfortunately the only one
 
That sucks
 
11:13 PM
so nothing gets fixed until i fix it. nothing gets done, whatsoever, until i done it... naw sayinnn.
i had a sales question that should have been able to been answered in 5 minutes...
turns out nobody knows how to use sales software except people in sales, and sales were the people that i didn't think knew what they were talking about, so going to them didn't help... now that its all said and done, I know how to use the sales software and figure out anything i'll ever need to know... now how do i catch up on those 2 days lost?? lol
that's my daily struggle
 
I feel very lucky to not have to deal with any of that
the worst part of my job is crazy vague requirements (SOP, I know) and constantly getting pulled away from my projects to do one-offs
 
i didn't, until i wanted to make sure the company money i was spending to build things was getting charged to the correct funds... which is wasn't.
 
but from what I have heard from others; its really not that bad
lol
We don't even have "sales" software
all the software is written in-house
so getting info just involves walking down the hall or checking out the source
 
look at this one... service team is telling the person that is supposed to be the SME on the software dealing with their product, but he/she is asking me what might be going wrong... typical response, "maybe try to install it then uninstall it"
its a single folder with an exe... there is no installer lol
 
wow
next: restart the computer
 
11:21 PM
@BradleyDotNET what i mean by that is pulling up part numbers, work orders, purchase orders, bills.
i'm glad i don't have to pull up source code to figure out the part number for a screw lol
;)
in other words, the ERP system.
I have an email chain that is about 20 e-mails long that jumps around from sales, purchasing, engineering, systems, board of directors, accounting, development... all because i wanted to do one thing--remove something from a sales order.
 
ouch
We just ask the hardware guys to get us the screw
or do whatever we needed the screw to do
 
that lead into finding out the order wasn't charged to the right account, and sales submitted the wrong order form, so purchasing goofed on some of the parts which means engineering had to change part numbers, which requires service to get involved for an RMA, and I needed a director to oversee the right account was charged by accounting....
 
googled ERP. Looks painful
 
all because i said, "yeahhh this item was never requested to be purchased, nor is it needed, please take it off the order"
so stupid
 
sounds like it
do you actually get to spend any time developing ;)
 
11:29 PM
Hello hello
me an another question :D
 
Hi Mehrad
 
Hey Brad. hope you both doing great
I am following this article to learn more about input validation
and in this section Very Simple Validation: ExceptionValidationRule
author gives a simple example for binding which lacks OnPropertyChanged
@BradleyDotNET would you be able to tell me why it's not there? I might be confusing so many things at the same time but i would appreciate it if you point it out
public class Customer
{
    private string _name;

    public string Name
    {
        get { return _name; }
        set { _name = value; } // <- here is the setter I mean
    }
}
 
Because the guy was lazy
or didn't expect to set the property from code
INPC only matters if the value changes out from under the UI
For input boxes, you usually don't actually need it
 
the 1st one was what came to my mind but you're right. if he isn't going to set it from the code why to bother
 
I've done it a few times myself :)
 
11:35 PM
totally
 
though usually because I'd rather have an auto-property
 
that's right. if we don't want to have OPChanged we can easily go with AutoProperty
dots connected :D
What he said in the 1st paragraph make me laugh though
Since User.Current.Electrocute() won't be added to the .NET Framework until .NET 4.0, most of us generally have to...
Cheers. :)
 
what is developing? bah!
 
@NETscape 1.grow or cause to grow and become more mature, advanced, or elaborate.
 
ahh, yes, i'm developing my knowledge on how to do everyone's job except mine!
 
11:41 PM
:)))
that's "devoting" rather :D
@NETscape we all devotlope sometimes, here and there
 

« first day (950 days earlier)      last day (3199 days later) »