« first day (553 days earlier)      last day (3596 days later) » 
07:00 - 18:0018:00 - 21:00

7:32 AM
morning all
 
8:10 AM
morning
 
8:42 AM
@ReedCopsey #The Swedish Way :D
also noticed that I need to pass index explicitly for the bindings to work
The ctors for colchangedargs could have been nicer, factory methods or something.
 
9:29 AM
Good morning
 
Morning
 
9:57 AM
morning Johan, Gregory and Lou
 
Morning again!
What's everyone up to?
 
currently trying to find a bug in vb6 :(
 
hehe
 
Hey EL :P
Im writing a 25 page report for my wpf project :( - what are you up to?
 
10:12 AM
@gregory.bmclub Dude, I'm doing that for a conference this Fall.
 
Hehe. I created a WPF project for my final year dissertation - i now have to do a write up for it :S.
 
Is that grad school or undergrad senior project?
 
Im a undergrad
Ive not finished my product yet but my write up is complete lol :S - it needs to be handed in on Tuesday too lol.
 
I'm doing an ASP.NET MVC app for mine, but they don't require such a long write up
 
that sounds cool :)
 
10:27 AM
It's fun. Hope you get yours working completely.
 
El morningo!
Greg when are you coming back on market shelves? :D
 
Haha - not anytime soon :P
Save to say, my WPF skills are pants. Or more to the point, my programming skills are pants lol.
 
damn.. i needs an asp.net minion!
one that can still write some bits of wpf :)
oh that's normal.. you're in uni
you're supposed to lose all skill in there as you feel super powerful with your semester projects :P
then the real life hits you smack in the face :D
 
For my grad job - they do both Java and .Net... Im thinking to stick with .Net Im a bit more familar with it! lol
 
most definitely
and wiht .net native around.. i see no reason why you'd want java
 
10:32 AM
Most of their appliances are java based though ^^.
 
hell the only real reason was to have portability - but xamarin pretty much knocked that out too imho
since I know they do android apps that are done in .net -- there's bound to something you can use in there
 
Taken me an hour to proof read my 30 page report... fml >.<
 
an hour.. thats good speed
proof reading is slow process
 
 
1 hour later…
11:51 AM
asparagus
 
broccoli
 
you win again Gregory... you always do. :P
 
12:26 PM
Are we talking about green things ? Because Hulk might be relevant
 
12:56 PM
Yo yo people
I need to load some information into a ViewModel, it takes a while so what would be the best way to do this? Running a task in the constructor and using INPC to notify the change when it's available or what? I was thinking of wiring the load event from the window up to a method on the ViewModel but that's not the done thing
@Maverik Piiiiing if you have a minute or two? Thx huni xoxoxoxox
@AndréSilva I've been bad. I haven't been for a run since monday
Actually no I didn't even go on Monday....
 
1:26 PM
@Sean God damnit Sean, I'm going to give you reasons to run >.>
 
@AndréSilva Did you know today is Friday?
 
TGIF
I had 4 mondays this week
 
That is too many.
 
Today I'll add you on D3 and I'll fix the document
But I'm going to stay until late at work again
 
I'm going out tonight, so none of that matters! :D
 
1:31 PM
Hell lot of work :(
Damn
Guess what, I'll probably have to work in the weekend
 
Exciting!
 
Yeah, at least they are paying me :D
And I still have to look up and study about the visa thing
So many responsabilities with so little time :(
 
@AndréSilva You're going to get naked ladies out and dangle them in front of me while I'm running?
 
Sean is here!
 
And Bill is here!
 
1:43 PM
Mav is here!
 
and I is here too nao @Sean
 
Brock is around too, just not here.
 
morn
 
dropped you line over in skype bill - dont suppose you've seen yet?
 
I didn't look at my pc today.
I could, I suppose. IS it something you can just say here?
 
1:44 PM
so, you're using what right now for this?
 
Work's PC.
 
yea but it'll spam the channel with a page full of my thing
hangouts?
 
Sure.
 
seems hangouts doesn't support file transfer O.O
gist it is!
 
@Sean No, I'll run naked following you and trying to hug you from behind
 
1:49 PM
guys, I have a problem when I try and convert a brush to a string and save it to a database... I get the following error within my OC "Value cannot be null."
 
new it? 0_o
 
@AndréSilva I dare you to try and keep up with me :D
 
Erm, is that an exception ? because only VB.NET lets it compile
 
@gregory.bmclub How are you converting a brush to a string?
 
@Sean Yeah, I'm a bit fat so...
 
1:56 PM
@Maverik It's cool, it needs to go somewhere else after all, I was overthinking
But thanks ^_^
@AndréSilva I uhm... Yeah I remembered you saying. That was mean of me, sorry
 
Nooo I wasn't being butthurt
 
@Sean When I add it to a database, I do the following; app.Colour = a.Color.ToString(); and I do this when to convert it back Color = converter.ConvertFromString(appointement.Colour) as Brush,
 
I was agreeing with you because I'm fat
I don't care to be called fat ;p My nickname in the company is fatty or fluffy
 
Hey, tons of fun, less talky more worky!
 
@gregory.bmclub That won't work. Your .ToString will give you something like "[System.Windows.Color] Red" when you just want the Red bit
 
1:58 PM
:( I can't excel just stopped working
 
The more you do now the less you have to do this weekend. Put down the fork and get working.
 
@AndréSilva Oh that's ok then ^_^
 
True story
 
(Of course I'm kidding. I probably weight two of you.)
 
@gregory.bmclub You already have a ColorConverter, right? I'm guessing that's the converter bit in your Color = bit. So use that same converter class and use it's ConvertToString method or whatever it is
 
2:01 PM
I was just using the following; ` BrushConverter converter = new BrushConverter();` for the converter...
 
BrushConverter has a ConvertToString method
Try passing your color in there, I'm guessing it will work if you are using a solid colour brush or whatever they are
 
Something like so? app.Colour = converter.ConvertToString(a.Color);
 
yarp
No
xD
 
Oh shit, yeah
 
2:03 PM
lol
Ill give it ago
 
crickey, i spy a wild @Sean!
 
I thought app.Colour was a Color object, I just re-read your code from before and saw that was the string you wanted =]
@NETscape You win a chocolate poo! Yay! :D
You completely missed the opportunity for some "what-ho chaps!" and other such English-isms
or England-isms, or whatever they're called
 
g'day guv
pip pip.
 
Still get the same issues :/
 
what's the output of the converter.converttostring method?
 
2:06 PM
I set it; as String
 
we didn't learn englishisms in school :( haha
 
@gregory.bmclub Can you see the value that is being stored in the DB?
 
@NETscape I had to read Great Expectations.
 
There isn't a row of data within the table...
When I add a row manually within SQL, it throws the same issue too.
 
Can you do a Debug/Console.WriteLine on the string you get back without trying to cast it? ConvertToString returns a string
Are you using a SolidColorBrush as well?
 
2:11 PM
This is my property; public Brush Color { get; set; }
 
Hmmmm
 
if it was anybody else, we would have flogged for the lack of code in this conversation
post gist of all relevant code
 
hey hey! I have a real WPF question! So I have a Button bound to a Command, this command has a CanExecute. I also have TextBox with a Validator. Right now the validator only controls the template of the TextBox, but is there anyway to insert it into the CanExecute?
 
MARKUS!
 
2:13 PM
HI!
 
why do you have Brush in a model?
 
Im using a scheduling application that I found and they put the Brush in the model... is that a bad thing?
 
you're using a View type in a Model type .. i'll leave it to that
 
You would be better of storing the color and then creating a brush from that color
Unless that's also unacceptable
 
if you had it as string.. and bound that direct .. you wouldn't need any converter
 
2:16 PM
And there speaks the voice of experience
Pro tip: don't listen to me :D
 
also what in the world is dis:
 private void NewEvent(object param)
        {
            DateTime? date = (DateTime?)param;
            DateTime? d = new DateTime();

            CurrentEvent = new Event();
            CurrentEvent.Color = CurrentEvent.Color;
            CurrentEvent.Start = (DateTime)d;
            CurrentEvent.Subject = "New event";
            CurrentEvent.End = (DateTime)d;
            CurrentEvent.Location = "";
            IsOpen = true;
        }
 
I was just following the code they provided - it works albiet unable to save a brush colour lol :S
 
that's some seriously amazing initialization code there!
 
Anyway thanks for the replies and whatnot but I really must go or I will get sucked in and not finish my shit. Bai!
 
2:18 PM
There he goes!
 
bai sean
greg.. change color to string type
and work as such
in theory xceed color picker should get a color because of implicit wpf string to color type converter
 
so... public String Color { get; set; }
 
yea
 
ooh, an error.
 
well yea i'd expect some resistance :D
 
2:21 PM
this.BorderElement.Background = e.Color; <- Cannot implicitly convert type 'string' to 'System.Windows.Media.Brush'
 
<Window x:Class="Test.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" Background="{Binding Color}">
</Window>
 public partial class MainWindow
    {
        public string Color { get; set; }
        public MainWindow()
        {
            Color = "Red";
            InitializeComponent();
            DataContext = this;
        }
    }
this is what i did and it gives me a red window
where Background is defined as (in Window class of MS):
[Bindable(true)]
    [Category("Appearance")]
    public Brush Background
    {
      get
      {
        return (Brush) this.GetValue(Control.BackgroundProperty);
      }
      set
      {
        this.SetValue(Control.BackgroundProperty, (object) value);
      }
    }
so in theory.. this works for "normal" things
is there a nuget i can use for color picker to check?
 
I was just using wpftoolkit
Because I changed it to string i get the following repercussion; this.BorderElement.Background = e.Color; <- Cannot implicitly convert type 'string' to 'System.Windows.Media.Brush'
 
frankly i don't know what you're doing but it works for me
<Window x:Class="Test.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="MainWindow" Height="350" Width="525">
    <DockPanel>
        <xctk:ColorPicker SelectedColor="{Binding Color, Mode=TwoWay}" DockPanel.Dock="Top"/>
        <Rectangle Fill="{Binding Color}" />
    </DockPanel>
</Window>
I've just added INPC to mix to support two way binding, but it works fine as it is
why are you doing this.Border.Background?!
again - thats what you get for code behind
 
I didn't do it - its an open source application that im trying to change to suit my own needs
:S
 
it just sucks man
understand the concept but dont use it
 
2:35 PM
Hmm.. it works, but because of this; this.BorderElement.Background = e.Color; it doesnt change the background colour.
The colour is saved within the DB as a Hex value though
 
Christ! i just realised
Color isn't an Enum
 
Hmm... :/
is there an alternative to doing this BorderElement.Background = e.Color;? within the xaml? Ive tried this; Background="{Binding Color}"
@Maverik - Where did you define the Background property?
 
whats your Color?
a type Color?
 
2:51 PM
say again @NETscape?
 
when you are trying to bind Color to Background... whats is the type for Color?
 
string
public string Color { get; set; }
 
Is the binding taking place before the Color is getting set maybe?
 
Quite possibly... unless I am not doing it correctly.
 
public string Color { get { return "Red";} }
try that and see if it turns red.
 
2:54 PM
If i set the background like so; Background="LightGreen" and when i add an event, the colour appears in lightgreen
 
maybe snoop it too
 
@NETscape when i do that i get the following error: must declare a body because it is not marked abstract, extern, or partial
 
you're tail spinning aren't you greg! :D
 
Yeah lol... ^^
What you told me Mav is correct.. it saves the colour to the DB but it doesn't change the background colour :S
 
yea you're messing that up
Background is UIElement.Background
and I just did exactly same thing with your ColorPicker that works just as well
 
3:02 PM
But if i do this; Background="LightGreen" its sets it programmatically and its fine :/
 
your problem is of course the fact that you're using code-behind which needs you do the heavy lifting that xaml is doing
create a sample project and do it yourself
once you get the idea of whats going on, then you can probably figure why it isn't working in your real project
 
There never seems to be a quick solution... lol ^^
 
well heres another idea.. if you REALLY have to use code behind
use int
 
greg why doesn't Color call INPC anyways?
 
3:08 PM
Thats my model...
 
uint color = (uint)Colors.Red.A << 24;
color |= (uint)Colors.Red.R << 16;
color |= (uint)Colors.Red.G << 8;
color |= (uint)Colors.Red.B;

(color >> 24).Dump();
(0x00FF & color >> 16).Dump();
(0x0000FF & color >> 8).Dump();
(0x000000FF & color).Dump();
this will get you a model that can be used for persistance
 
Wouldn't i have to do that for every colour?
 
then you can use Color.FromARGB(color >> 24, 0x00FF & color >> 16, 0x0000FF & color >> 8, 0x000000FF & color) to get the real thing back
no strings involved
create an extension method
 
thats mind boggling...
 
the first half serializes color into a uint32 (i can give you a snippet to round trip uint to int in sql and back)
the second half deserializes
 
3:21 PM
hmm :/
 
3:39 PM
Color is a load of static properties, IIRC. Fun times
How would I display conditional strings based on a count of a list in a DataTemplate?
Or anything, really. I want to display "There are {x} warnings." and if x > 0 then I also want a button. Would that just be a trigger?
 
sounds like it, mixed with StringFormat
 
StringFormat would do the {x} bit but then I could aaaaaaaaah
Got it, thanks
 
@Sean have the default case deal with > 0 warnings and trigger on if x== 0
 
I was thinking button isvisible checking on the count being over 0
With a converter, of course
Then the string should always show
Easy pie
 
I feel so inadequate when i come in this chat lol :S
 
3:52 PM
Don't. I only just manage to get by with the UI stuff in WPF
 
I wouldn't know where to begin with what you want to achieve (the question you just asked!)! I dread to think what you guys think to my application lol - probs a load of tosh!
 
FYI:
<DataGridTemplateColumn Header="Warnings" Width="Auto">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <DockPanel>
                <Button Content="Show Warnings" DockPanel.Dock="Right" />
                <TextBlock Text="{Binding DataValidationResults.Count, StringFormat='There are {0:D} warnings'}" />
            </DockPanel>
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Not fully done but it gives you an idea of what I was talking about
And I need to change it anyway because you can't have conditions in bindings. This is where MVVM comes in, you should have this kind of shit in your View Model
(disclaimer: I actually do have a view model)
public List<EmployeeDataValidationResult> DataValidationResults { get; set; }
public int WarningCount
{
    get
    {
        return DataValidationResults.Count(dvr => dvr.PassedValidation == false);
    }
}
<TextBlock Text="{Binding WarningCount, StringFormat='There are {0:D} warnings'}" />
It's not that complicated once you understand the separation
@Maverik I get what you mean now because Value has to be an equal to. Again, there speaks the voice of experience
 
as long as you get there, its all good :)
and you may want to use ItemsControl.HasItems to trigger your button
since if you're showing a collection of warnings, itemscontrol is bound to be in there somewhere as well
 
I don't think that will work
And no it's not
popup
 
o ok then
 
4:02 PM
It's fugly but I don't have time to waste on making it all pretty
 
yea I understand what you mean :)
wanna come over to my place? :D I is looking for an asp.net minion :)
you can teach me asp.net and I can share some of my nooby wpf stuff!
dont tell rudi! :D
 
"Do you want to come to my place? Bouncy bouncy."
 
precisely... we're studying
 
Oh god we all know what that means
I'll bring many lubes
 
you still need those? :D
 
4:03 PM
And some painkillers
First time babes
 
poppers ftw!
no pain.. full gain!
 
Hahaha which one is that again? I forget the proper name for it
 
the muscle relaxant
 
There are many... I did know which one it was but it's been ages since I heard that
 
i've never done them, but i've seen others use it.. i'm not sure how they sniff that shiz
 
4:05 PM
Oh, ketamine? Why do they call it poppers?
Not ketamine
 
I'll let Dr. Wiki explain
 
I literally just hit the same page
 
that inline link looks pretty decent considering its context!
 
I dunno, my nose is relatively innocent
 
like almost legit mathematical business!
 
4:07 PM
Of course, who better to represent sex drugs than a classy looking guy in a black and white picture?
 
nothing like a friday in chat!
 
Well I have to go now anyway, my lift is making a run for it
As always, thanks for the help and my data trigger works perfectly, awesomesauce
 
have a great weekend
 
See you around guys, have a good weekend
 
and yws
 
4:09 PM
imagining Sean taking off in his lift like this: youtube.com/watch?v=K3QQCC8oRIQ
 
1 message moved to recycle bin
 
@Sean I'm working as a programmer now
 
fulltime johan?
 
4:31 PM
Trying to meet with friends who have kids sucks so bad.
 
4:43 PM
@NETscape I have a 100% + 100% deal :D
 
5:00 PM
Is there a way to declare a new brush rather then defining it like so? CurrentEvent.Color = Brushes.Red;
 
?
 
@NETscape ahahahahahaha ^_^
 
That probably made no sense at all... lol
 
@gregory.bmclub Yes but Brush is abstract, I believe. There is such a thing as SolidColorBrush which you can feed hex values and whatnot
 
5:03 PM
Yeah - I just saw that before you posted!
I did something like so; CurrentEvent.Color = new SolidColorBrush();
 
@JohanLarsson Cool, what are you working on? Just vague ballpark if it's all private and confidential
 
secret stuff but it is the program for an NC-machine, lots of UI & math
 
Aaaaaah cool =]
 
Hmm... I use the new SolidColorBrushbut it doesnt save the colour I pick...
eg; red. Thats odd
 
Saving it to the DB?
 
5:07 PM
it saves the colour as transparent.. not the selected colour
 
Is that using the same BrushConverter from before?
 
Ive changed my method to the following;
 public List<Event> EventList()
        {
            List<Event> events = new List<Event>();
            using (SchoolAdminDBEntities db = new SchoolAdminDBEntities())
            {
                BrushConverter converter = new BrushConverter();

                string loggedInUserName = Thread.CurrentPrincipal.Identity.Name;
                var appointments = db.Appointments.Where(a => a.User.Username.Equals(loggedInUserName)).ToList();

                foreach (var appointement in appointments)
 
and appointment.Colour is "Transparent"?
 
it saves it as transparent.. migth be the default colour.
 
Is that because you haven't bound the property to the view properly?
 
5:11 PM
SelectedColor="{Binding CurrentEvent.Color
 
Actually no your binding looks ok
 
I use this to add; app.Colour = converter.ConvertToString(a.Color);
 
So that's the bit that gets the string and saves to your DB
I guess what you could try is putting a breakpoint on that line and seeing what a.Color is
 
when I add?
 
Yes, in your AddAppointment method
If your gist is still semi-valid
 
5:14 PM
its "#00FFFFFF" apparently.. even though i select "tomato" colour.. lol
 
No that's transparent, 0 alpha and white
 
exactly.. it always saves as transparent.
 
Ok, try changing your property and seeing if the setter is ever called
 
I updated my gist anyways
 
public Brush Color { get; set; }

to

private Brush _color;
public Brush Color
{
    get { return _color; }
    set { _color = value; } // breakpoint here and inspect value if the breakpoint is hit after you change it in the UI
}
Oh
You spanner :D
CurrentEvent.Color = new SolidColorBrush(); in your NewEvent command of course it's going to be transparent ^_^
Ah no I'm being an idiot... Sorry
How is AddAppointment called?
 
5:21 PM
RelayCommand _SaveEventCommand;
        public ICommand SaveEventCommand
        {
            get
            {
                if (_SaveEventCommand == null) _SaveEventCommand = new RelayCommand(param => this.SaveEvent());
                return _SaveEventCommand;
            }
        }

        private void SaveEvent()
        {
            if (!WpfScheduleEvents.Contains(CurrentEvent))
            {
                WpfScheduleEvents.Add(CurrentEvent);
                rep.AddAppointment(CurrentEvent);
 
Hmmmm I don't have VS on this PC....
It's downloading and installing now
 
You honestly downloading it? I dont want to be a nuisence.
 
I'm bored and at home
It's this or daily fail centre
 
Better be bored at home than bored at work :(
 
Indeed, at least I can look at the naked ladies you won't dangle in front of me at home
 
5:27 PM
I'm never bored at work
 
I get bored of doing the same thing over and over. I don't get bored because I have nothing to do
 
^
I'm doing some excel thing.. It is boring as hell
 
Updated my gist if that helps...
 
I just get annoyed with myself for working slowly
 
Wait, I just got back from the bathroom, what did you removed ? D:
 
5:41 PM
just a random micro rant
 
Oh, ok then
 
I'm sorry for whatever offense I may have caused.
 
I am aware the world revolves around me. So I assume I am the source of your swallowed ire.
 
Come on Bill you're not fat to have attention orbiting around you...
 
5:54 PM
There's almost a joke there.
"You're so fat the world has to revolve around you, it's a Newtonian law!"
 
:D Exactly, I heard that one today :(
 
I find that hard to believe.
 
@gregory.bmclub
lolwat
sorry on the phone =P
 
07:00 - 18:0018:00 - 21:00

« first day (553 days earlier)      last day (3596 days later) »