« first day (2349 days earlier)      last day (1800 days later) » 

9:48 AM
Good morning all :-)
 
10:12 AM
Hi guys
 
Hi grandangelo :-)
 
one question: I've a beautiful TextBox with its validation rule.
When rule is not satisfied, a red border is drawn around my TextBox.
I don't understand how to change this red border thickness. I tried wrapping the TexBox with a Border, or setting the TextBox Margin or Padding without any luck.
Neither I found something useful on SO.
Can you please give me an advice?
 
Thats validation error template
 
oooook... thank you XAM|MAX
 
np :-)
 
10:22 AM
here it is:
<Style TargetType="{x:Type TextBox}">
    <Setter Property="Validation.ErrorTemplate">
        <Setter.Value>
            <ControlTemplate>
                <Border BorderBrush="Red"
                        BorderThickness="3">
                    <AdornedElementPlaceholder />
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
easy if you now what to look for :-)
 
Excellent! :-)
You are in the right place to ask
 
10:57 AM
Morning
 
Morning Alex
 
Hi Xaml
 
11:31 AM
Hi guys
 
Hi Mav
 
o/
 
11:57 AM
Hey Maverik
 
Sir :)
 
Showed the JSON patch link you shared to a friend at work and he was blown away by it
Too many amazing stuff going on out there
Want to find the time to read up on PWAs
 
12:42 PM
gm all
 
Morning, Lynn
For some reason, Chrome isn't letting me see the errors in its console
It gives me the total errors in top right hand side. But no details
 
1:03 PM
Hi guys
I am having problem adding textbox to each of the row of datagridview in winform application
 
Hi Learning. You may have a challenge getting answers to that here.
We do WPF/XAML tech
 
All right Alex
No problem :)
 
Good luck, Learning
 
1:20 PM
Thanks alex
and wish you the same :)
 
any idea about how can i use service broker to create jwt authentication in wpf?
 
1:50 PM
MoreMag, just ran a google on your question: auth0.com/blog/add-auth-to-native-desktop-csharp-apps-with-jwt
That article covers JWT auth w/ WPF specifically
The service broker piece is something else
 
i don't think it's a question we can answer
 
^ what Maverik said
 
2:07 PM
How do you get webapi to return json instead of xml?
 
send in your header accepts:application/xml
 
json is the default iirc
 
I just was looking at this example docs.microsoft.com/en-us/aspnet/web-api/overview/…
and when I added the controller and get items, it returned it as XML
 
you're in classic webapi and not core web api right?
 
yeah
one solution says I need to wrap the result in { }
 
2:10 PM
ha ha sorry, send accept:application/json
 
should just work with content negotiation out of the box
yea that header
 
this is my controller

    public class OCRController : ApiController
    {
        public IEnumerable<string> GetAllProducts()
        {
            return new List<string>() { "1", "2" };
        }
        public IHttpActionResult GetProduct(int id)
        {
            return Ok("test");
        }
    }
 
How do you request data from it? AJAX? jQuery?
 
just in the browser that launched in debug mode like - localhost:57368/api/OCR/3
 
that's the problem
 
2:13 PM
Have a look at the network tab
 
your browser is asking for text/html content - your API doesn't have that type.. so it's picking up the first format that it can respond with which happens to be xml
 
in developer options
What Mav said +1
 
if you have VS Code, this is an amazing extension for testing http requests: github.com/Huachao/vscode-restclient
GET localhost:57368/api/OCR/3
Accept: application/json
^ that's all it'll take to get result
haven't gone back to postman or anything of the sort since I found this extension
 
that's a bald statement! :-)
 
bold
 
2:19 PM
ha ha yes, I mean bold!
Shame it doesn't have NTLM support
 
O.O
guessing you mean Integrated authentication..
 
I used postman instead, it wasn't obvious how to use the VSCode extension so I gave up on it :/
 
Yes, that's what I mean Mav
 
@erotavlas you mean the extensive documenation provided on the page was too extensive to spend time reading :) - you could have just copy pasted my code
 
well it said to paste the link in the editor and this send request is supposed to appear, but I saw nothing appear
 
2:34 PM
because you ran it as Plain text file i bet
you're supposed to set language mode to Http
 
ok that did it, thanks
 
2:51 PM
you're welcome
 
 
4 hours later…
7:16 PM
Hello, I used [this tutorial](https://www.technical-recipes.com/2018/navigating-between-views-in-wpf-mvvm/) to learn about how to change views in WPF using MVVM. I got their sample setup and working, but after handling some dependency injection using SimpleInjector library, the buttons that change my views broke. I seem to be stuck in a CanExecute loop found in RelayCommand.cs.

Does anyone have any insight on this?
 
8:01 PM
Maybe you're running into this: stackoverflow.com/a/33149910/177416
 
In my code, CanExecute implements method from interface System.Windows.Interface.ICommand using .NET 4.7. I will keep reading, but just thought this extra information might help. Also, the code that I found using the tutorial that I linked works and I am able to change views using that code. So I'm confused as to why it isn't working anymore. It happened after I started injecting dependencies, but that could also be a rabbit hole.
 
8:23 PM
Maybe you can just show us your code?
 
@ButterJones Please provide a gist.
 
0
Q: Why C# WPF button binding command won't change view after using simple injector?

ButterJonesI'm using the following articles for starter code: Navigating Between Views in WPF MVVM Simple Injector WPF Integration Objective: Trying to go from View 1 to View 2 in WPF form using a button binding command and Simple Injector to inject dependencies into views. Note: These dependencies are rep...

Next time, please, give a link to the Q if it exist. It will save some time from additional questions
 
Yes, sorry that is the question.
 
8:47 PM
Also, the EventHandler CanExecuteChanged is never called when I click my button, however it does in the example tutorial.
 
9:08 PM
I'll take a look tomorrow
 
Thanks for the help.
 
well, not so much yet
but this room is very good place to know something new
 
Yeah, I'm pretty new to WPF and MVVM so those two things together are making this difficult for me to debug. And if you have any other suggestions (ie. scrap my code and use a different method) then that's cool with me.
 
it can be hard since I'm from F# world :-)
 
 
3 hours later…
11:56 PM
@ButterJones pretty late to say something in depth but it sounds to me like SimpleInjector may be causing you to move from UI thread to another one.. considering you say the code works if you remove SimpleInjector from equation.. this sort of behaviour is typical in cross threaded scenarios.. UI will not respond to things happening on other threads and its pretty frustrating thing to debug
 

« first day (2349 days earlier)      last day (1800 days later) »