« first day (1208 days earlier)      last day (2941 days later) » 

2:34 AM
0
Q: Clip BitmapImage using Strokes from a InkCanvas

Nicke ManarinI'm tasked to create a "Cinemagraph" feature, the user must select a desired area using an InkCanvas to draw the selected pixels that should remain untouched for the rest of the animation/video (or, to select the pixels that should be "alive"). Example: I'm thinking about getting the Stroke co...

 
 
3 hours later…
5:48 AM
got DialogCoordinator implemented
should be a lot better
:)
now I just need to build a que system for it
 
6:16 AM
or make it resize...
 
 
3 hours later…
user4433485
8:54 AM
heya
 
9:18 AM
heyo
bought a Yaris HSD :p
 
user4433485
Lol rly?:p
 
yep
delivery this saturday
 
9:38 AM
Why you don't buy a french car :3
 
cos he knows they're all crap
 
lol
 
user4433485
9:52 AM
:p
 
user4433485
I am thinking about Porsche Cayman
 
Kat still hasn't gained knowledge that Porsches are also crap :P
 
user4433485
haha
 
user4433485
I grew up with Porsches and BMW ^^ Cant help it
 
user4433485
But @RudiVisser You were right about the Windows Phone, Love it !
 
10:03 AM
Yay good news
This video makes me so happy
 
user4433485
I was wondering, how difficult is it to make a small app for Windows Phone
 
Not hard at all, it's basically WPF :P
 
user4433485
Really?
 
user4433485
Have to take a look :D
 
Yes, there's a lot of new controls from the universal platform but pretty much the same
Also it's all async whether you like it or not
 
10:12 AM
@Hamza_L it's made in France
 
10:34 AM
Ughh anybody had experiecne calculating the width of a text string?
No matter what i try, its always too small
 
@Asheh You can measure it precisely with FormattedText class.
 
@NovitchiS yes I am doing that
But ive just realised that the string with the greatest characters is not nessecarily the largest
Which is where I fail
which means I need to measure every string
I hope formattedtext is fast... lol
Hey it worked, its pretty fast
Any way we can make this faster?
 
maybe don't instantiate a new TypeFace for each element
 
done
 
10:54 AM
how many strings do you have ?
 
over 10k
 
maybe you could map each different char to its width
also check which character is the largest and which is the smallest and don't compute the width for strings which length(someString) * maxCharWidth < length(longestString) * minCharWidth
 
thats a potential optimization i was thinking that
For now the format text is fast enough!
Woohoooo
 
11:17 AM
Can you bind to a string length?
Im trying to hide somthing in a style if its bound string is empty
Got it, i can bind to content
and check against string.empty
<3 WPF.
 
 
2 hours later…
1:12 PM
@Asheh yes you can :)
@KyleHumfeld that would have been me and I'm loving the game so far :)
@KyleHumfeld there's an entity framework link in our stars that has EF5/6 tutorials
What you do today is important because you are exchanging a day of your life for it <-- somebody's quote, author unknown.. but wow.. deep!
 
1:51 PM
hi everybody guys
Is there a way to display in a combobox the indexes of the objects of the ItemsSource elements?
I mean, I would like to see 1,2,3,4
 
2:17 PM
 
Thanks ;)
 
2:30 PM
omg
What is going on
Am I going mental? Or is that perfectly right
It's throwing an "Object does not match target type." exception, and I cannot see for the life of me why it would do this
It seems Uri is the only type affected by this, the method works for most other types tested
lol even this doesn't work
    private static void SetPropertyValue(object obj, string propName, object val)
    {
        var prop = GetProperty(obj, propName);
        prop.SetValue(obj, Convert.ChangeType(val, prop.PropertyType));
    }
Nevermind
 
wat waz it
 
I'm not sure it was even that
Its stack trace is within a static constructor, so without a myriad of breakpoints it just throws a TypeInitializationException with an InnerException prop containing the main stack trace, and it was just the same error recurring for 3 different reasons. Each time I fixed one I thought the same thing was recurring
Basically was being an idiot
 
3:00 PM
posted on February 09, 2016 by ericlippert

You are ten feet above the ground, nestled among large branches. Beside you on the branch is a small bird’s nest. In the bird’s nest is a large egg encrusted with precious jewels, apparently scavenged by a childless songbird. > … Continue reading →

 
3:29 PM
Morning guys!
Has anyone of you played around with asp.net and language support?
 
nein
 
First of all, is it possible to debug the aspx pages in some way?
 
3:45 PM
Thats a good one.. thanks . . .
 
Well, it is the quickest way, what are you failing to debug?
 
ok, so what I meant to say was if I could set a breakpoint in a aspx file
but I kind of get that it doesn't really work...
 
4:04 PM
It should work fine though
I mean unless you're doing anything particularly complicated
 
Well... I thought I could break at a script (not in the aspx.cs file) but... I think it's all in my head :)
 
4:52 PM
as long as you F5 in the correct program it should work
be it typescript / js / aspx / ironpython .. whatever else!
F5 in IE will not help you debug... F5 in katana.. should..
or Cassini for that matter
 
5:25 PM
Are event based returns and methods better than straight up returning a result for processes to complete?
(especially if dialogs need to be shown based on the result?)
 
 
1 hour later…
6:30 PM
it depends on your requirements really... if you're showing a dialog window, meaning the user can't use the background windows unless they clear the dialog window, then you should just return the result of the dialog window and pass it along.
@JoshMenzel if its not a dialog window, then you'd pass messages between view models/services. if you need to know when a window was closed or something of that nature, then use an event (or maybe???? an attached behavior)
 
I want to interface with the DialogCoordinator, which I have working now
but
every time I try to use it from a separate worker thread
I get invalidoperationexceptions
 
right, because you have to show it from the UI thread i'm assuming
 
(calling thread cannot access object because the calling thread does not own the target object)
well at least the viewmodel thread
if I call it directly from the vm, it's fine
so I was going to build a separate object or set of objects
that have basic functions on them
(async void functions)
then, they fire events when they return a result
the vm would subscribe to those events and from there, based on the result, can throw up the appropriate dialog
since the event function will be running on the vm thread, it shouldn't object to having to show the dialog
and that will allow the functions/scripts to run on background workers
 
are the VMs created on a separate thread?
 
not sure
I just follow MVVM
 
6:37 PM
if you have:
public MainWindow()
{
    InitializeComponent();
    DataContext = new MainViewModel(....);
}
your VM is created on the UI thread
and thats where it lives
 
that's my codebehind for my mainwindow
so it looks like it's on the same thread
so would it work for me to do things the way I am planning?
 
ShowMessage should be a rather simple call.
 
I'd call a function, say MainFunctions.RunUpdateCheck() on window loaded event which would fire from the interactivity dll and then in turn, the RUnUpdateCheck function would have an event, say RunUpdateCheckCompleted
which would be subscribed
and that would return the RunUpdateCheckResult
along with any errors
because I can't say await coordinator.ShowMessageAsync(....) from a backgroundworker.dowork function, even if the vm owns the background worker
it still generates an invalidoperationexception
 
can you just do:

public void ShowMessage(string Title, string Message, Boolean exit, Boolean resize = true)
{
    _parent.ShowMessage(Title, Message, MessageDialogStyle.Affirmative, new MetroDialogSettings { ColorScheme = MetroDialogColorScheme.Accented });
}
 
nope
because the showmessage MUST be async
(it's how mahapps.metro is built)
dragablz.net/2015/05/29/using-mahapps-dialog-boxes-in-a-mvvm-setup/
this is the reference I used to allow the vm to make the dialog calls
 
6:46 PM
right, so you should be calling _dialogCoordinator.ShowMessageAsync(this, "Message from VM", "MVVM based dialogs!") from your VM
that's why you pass DialogCoordinator.Instance to your MainVM
and since its Async, you need to call it from an async method... and if you're using Commands, your ICommand implementation needs to be async'able
 
That's correct
I call the coordinator from the vm now
and my RelayCommand is async'able
that's my RelayCommand provided by Lynn
but say I have vm.UpdateWorker as a backgroundworker object
the backgroundworker.dowork function can't call dialogCoordinator.ShowMessasgeAsync because it isn't on the vm thread
that's the issue
development ^
 
that RelayCommand isn't async
 
no, but I can define the functions as being async'able...
new RelayCommand(myasyncfunct);
unless there is a more advanced version of the RelayCommand I should be using
I mean, with the amount of web requests I make for this program, it should be async commands
 
so I can use that instead of RelayCommand?
 
6:55 PM
you would use AsyncCommand when you need to execute awaitable (async) functions
and relaycommand when you don't
there are a bunch of asyncommands out there... some work differently than others
 
okay so what's the difference between using the async command vs relaycommand?
is it just depending on the function that I call from that command?
(ie. if the function is async Task<> or async void, use the asynccommand, if not, use relaycommand?)
 
you should always await and async method right? In order to do that, you need an async method. With RelayCommand you can't used async methods, with AsyncCommand, you can.
@JoshMenzel correct.
 
okay
well, how do I define a function for asynccommand
it saying that a private async void has the wrong return type
or do I just change void to Task
or Task<>
 
_loadedCommand = new AsyncCommand(async f => await InitializeProgress());
and InitializeProgress should she something like
private async ________ InitializeProgress() { ..... }
 
ahhh
got it using the same code
    #region MainWindow Loaded
    private AsyncCommand _LoadedCommand { get; set; }
    public AsyncCommand LoadedCommand
    {
        get
        {
            if(_LoadedCommand == null)
            {
                _LoadedCommand = new AsyncCommand(InitializeProgram);
            }
            return _LoadedCommand;
        }
    }
    #endregion
private async Task InitializeProgram(object current)
    {
        //var result = await MainFunctions.CheckForUpdates()
        //if(result == Results.Error.......
        var result = await myCoordinator.ShowMessageAsync(this, "Testing", "Test message", MessageDialogStyle.Affirmative, new MetroDialogSettings { ColorScheme = MetroDialogColorScheme.Accented });
        Debug.WriteLine(result.ToString());
    }
and that did not give me an error! :)
 
7:04 PM
yes.
 
Thank you!!!!!!!!!!
 
i suggest reading async/await literature to understand it fully. even after reading i don't completely understand how to design everything, but have an idea of how it works.
 
where is said literature
 
Internets
 
lol ok
thanks for the help on this
 
7:11 PM
np
 
I think I'm still going to build separate classes to contain the different functions I need
then I can call them from the async commands
 
don't async things just because you can. async them because they should be async.
 
well for starters, anything related to making web calls
should be async
 
Curious: why is Netscape with an IE icon?
 
7:26 PM
johan held me at gun point and told me to change, or else.
 
@JohanLarsson can you find that gun again and finish this business completely please? ^
 
lol
 
@Maverik my fault
I still think it is right :)
 
no i mean change his nick to match
it's high time he accepted evolution!
 
laugh
@NETscape Don't feel bad; I'll be renaming myself to Dr. ShrimpDrive shortly.
 
7:38 PM
so would it still be worth it for me to setup events for my program to consume?
even if I don't use them?
 
I wouldn't.... my $0.02
 
would it provide added benefits for expansion?
 
I wouldn't either... my £0.01
Josh let YAGNI guide you
DRY KIS SOLID YAGNI
remember those and it should answer most design questions before you have the need to ask them from random web strangers that have no clue about your project architecture :)
 
huh?
What the *** is YAGNI?
(not the F word ^ )
 
7:56 PM
i knew you'd ask.. so my answer was ready: google before you ask
whatever you have to ask, chances are somebody has asked already and somebody else answered it much better than I can
but YAGNI is simple: You Ain't Gonna Need It
still do read on what it really means
 
lol ok
my google foo is weak and my intelligence is well...null ;)
 
 
3 hours later…
10:54 PM
Would be nice if dp validation returned a string instead of a bool
Not sure how to use it really
Not an ideal channel to the xaml designer
Perhaps I can throw but it feels strange given the signature.
 

« first day (1208 days earlier)      last day (2941 days later) »