Honza K.
Honza K.
CC#
Created by bhavish on 1/21/2025 in #help
✅ Request error: The SSL connection could not be established, see inner exception.
If I knew you can change it in project settings I would say that lol
63 replies
CC#
Created by bhavish on 1/21/2025 in #help
✅ Request error: The SSL connection could not be established, see inner exception.
I had no clue you can change the TLS version like this
63 replies
CC#
Created by bhavish on 1/21/2025 in #help
✅ Request error: The SSL connection could not be established, see inner exception.
yeah but the link shows how to use the sockets handler 😄
63 replies
CC#
Created by bhavish on 1/21/2025 in #help
✅ Request error: The SSL connection could not be established, see inner exception.
I'm not sure this would help with the posted error... that is why I posted the link to migration FROM web request as it shows how to use the SocketsHttpHandler... not saying anybody should use http web request in modern .net
63 replies
CC#
Created by bhavish on 1/21/2025 in #help
✅ Request error: The SSL connection could not be established, see inner exception.
63 replies
CC#
Created by bhavish on 1/21/2025 in #help
✅ Request error: The SSL connection could not be established, see inner exception.
you can try this new HttpClient(new SocketsHttpHandler() { SslOptions = { EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12 } });
63 replies
CC#
Created by bhavish on 1/21/2025 in #help
✅ Request error: The SSL connection could not be established, see inner exception.
are you expected to use TLS v1.3? AFAIK it is not supported on macOS
63 replies
CC#
Created by bhavish on 1/21/2025 in #help
✅ Request error: The SSL connection could not be established, see inner exception.
Interop+AppleCrypto+SslException: bad protocol version
63 replies
CC#
Created by bhavish on 1/21/2025 in #help
✅ Request error: The SSL connection could not be established, see inner exception.
Show us the exception + inner exceptions... Most likely the server's SSL certificate is not trusted on your machine
63 replies
CC#
Created by Ras Gulla on 1/15/2025 in #help
Newtonsoft Json not deserializing with some property/constructor names
IMO all you had to do was place [JsonProperty("UniqueID")] on the constructor id parameter 😄
42 replies
CC#
Created by Neo | QuantFreedom on 11/9/2024 in #help
Avalonia Data Trigger
You can also apply classes to a control based on some condition, which can be pretty handy https://docs.avaloniaui.net/docs/basics/user-interface/styling/style-classes#conditional-classes
23 replies
CC#
Created by Neo | QuantFreedom on 11/9/2024 in #help
Avalonia Data Trigger
you can also select something by some of its property value https://docs.avaloniaui.net/docs/reference/styles/style-selector-syntax#by-property-match
23 replies
CC#
Created by Neo | QuantFreedom on 11/9/2024 in #help
Avalonia Data Trigger
you have to use template selector whenever in the default template they decided to change some properties of something that isn't shown in logical tree of the control, in case of a button, the background is set on a ContentPresenter and in case of :pointerover trigger, they're setting the background the same way you have to, they select the parent (button/toogle button), go into template selector and select ContentPresenter#PART_ContentPresenter (ContentPresenter type with PART_ContentPresenter name) and set the Background property to some value
23 replies
CC#
Created by Honza K. on 3/29/2024 in #help
Avalonia UI - binding in markup extension?
public class StringLocalizationExtension : MarkupExtension
{
#pragma warning disable IDE0290 // Use primary constructor
public StringLocalizationExtension(string key)
{
Key = key;
}
#pragma warning restore IDE0290 // Use primary constructor
public string? Key { get; set; }

public override object ProvideValue(IServiceProvider serviceProvider)
{
var binding = new ReflectionBindingExtension($"[{Key}]")
{
Mode = BindingMode.OneWay,
Source = Internal.StringLocalizationResolver.Instance,
};

return binding.ProvideValue(serviceProvider);
}
}

public class StringLocalizationResolver(ICAFluentUINet.Abstractions.Localization.IStringLocalizer stringLocalizer) : INotifyPropertyChanged
{
private readonly IStringLocalizer _stringLocalizer = stringLocalizer;
private const string IndexerName = "Item";
private const string IndexerArrayName = "Item[]";

#pragma warning disable CS8612 // Nullability of reference types in type doesn't match implicitly implemented member.
public event PropertyChangedEventHandler PropertyChanged;
#pragma warning restore CS8612 // Nullability of reference types in type doesn't match implicitly implemented member.
public static StringLocalizationResolver? Instance { get; set; }

public string this[string key] => _stringLocalizer.Get(key);

public void Invalidate()
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(IndexerName));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(IndexerArrayName));
}
}
public class StringLocalizationExtension : MarkupExtension
{
#pragma warning disable IDE0290 // Use primary constructor
public StringLocalizationExtension(string key)
{
Key = key;
}
#pragma warning restore IDE0290 // Use primary constructor
public string? Key { get; set; }

public override object ProvideValue(IServiceProvider serviceProvider)
{
var binding = new ReflectionBindingExtension($"[{Key}]")
{
Mode = BindingMode.OneWay,
Source = Internal.StringLocalizationResolver.Instance,
};

return binding.ProvideValue(serviceProvider);
}
}

public class StringLocalizationResolver(ICAFluentUINet.Abstractions.Localization.IStringLocalizer stringLocalizer) : INotifyPropertyChanged
{
private readonly IStringLocalizer _stringLocalizer = stringLocalizer;
private const string IndexerName = "Item";
private const string IndexerArrayName = "Item[]";

#pragma warning disable CS8612 // Nullability of reference types in type doesn't match implicitly implemented member.
public event PropertyChangedEventHandler PropertyChanged;
#pragma warning restore CS8612 // Nullability of reference types in type doesn't match implicitly implemented member.
public static StringLocalizationResolver? Instance { get; set; }

public string this[string key] => _stringLocalizer.Get(key);

public void Invalidate()
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(IndexerName));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(IndexerArrayName));
}
}
2 replies
CC#
Created by Kagano on 2/26/2024 in #help
✅ Avalonia UI button doesn't color by hover!
you must change it in the template itself...
<Style Selector="Button:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource Button.MouseOver.Background}"/>
<Setter Property="TextBlock.Foreground" Value="{DynamicResource Button.Foreground}"/>
</Style>
<Style Selector="Button:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource Button.MouseOver.Background}"/>
<Setter Property="TextBlock.Foreground" Value="{DynamicResource Button.Foreground}"/>
</Style>
4 replies
CC#
Created by 𝕭𝖔𝖙𝖙𝖑𝖊_𝕭𝖆𝖗𝖔𝖓 on 2/23/2024 in #help
Trying to scaffold a controller for ASP .NET api using MongoDB but get this message
This shit gets broken quite often actually... I never managed to fix it, I always created a new empty project and did the scaffold action there and just copied the stuff out to my actual project 😄
5 replies
CC#
Created by Shiv on 2/19/2024 in #help
Scheduling task in c# with failproof mechanism
thanks for the info, my answer is based purely on the Nick's video and I didn't look at the library myself... It's good to know it is a paid library and the free version kinda sucks
14 replies
CC#
Created by Shiv on 2/19/2024 in #help
Scheduling task in c# with failproof mechanism
14 replies
CC#
Created by lugende on 1/11/2024 in #help
why does this Not work?
3 replies