Quantcast
Channel: User Sinatr - Stack Overflow
Browsing latest articles
Browse All 367 View Live
↧

Does `Property` path syntax supports casting in Avalonia, like in WPF?

Often in WPF we need to cast property to specific type to be able to access further properties in the path, e.g. from some...

View Article


Why using null-conditional operator in nullable context breaks static analyzer?

Why after using null-conditional-operator in nullable context (#nullable enable) the static analyzer shows CS8602 warning?var test = new List<int>();Console.WriteLine(test.Count); //...

View Article


Read-only (visually) CheckBox

I need to have 2 groups of controls on the screen: inputs and outputs (so they have 2 states: On or Off). Thus CheckBox seems to be a good choice. Checking any output will set it.However, when...

View Article

Answer by Sinatr for Why application crashes after signing?

This cryptic error doesn't tell about specific reason of the crash, which in my case was missing entitlement. Sure, it's code-signing related, but... /sighIf someone could post an answer, how to find...

View Article

Why application crashes after signing?

The problem is that my app bundle works before signing and crashes if I use codesign and I am absolutely clueless as to how find out the reasons. Can someone push me in the right direction?I am getting...

View Article


ScrollIntoView and ListView with virtualization

I have ListView (virtualization is on by default), which ItemsSource is bound to ObservableCollection<Item> property.When data are populated (property is set and notification is rised) I see 2...

View Article

Is it possible to customize only single member output without rewriting...

I have record with many members and I want Console.WriteLine(myRecord); to output its values. However one of its members is an array and it will be printed as MyOtherRecordType.Item[]Is there a an easy...

View Article

Memory leak, but where?

I can't understand what is leaking hereusing GDI = System.Drawing;public partial class MainWindow : Window{ [DllImport("gdi32.dll")] private static extern bool DeleteObject(IntPtr obj); public...

View Article


Image may be NSFW.
Clik here to view.

Answer by Sinatr for Accessing dynamic view within ExpandoObject

You can surely do a lot to enhance your debugging experience. Here is my quick attempt:I had to use composition to extend sealed class ExpandoObject with attributes:class MyExpando{...

View Article


Answer by Sinatr for How to avoid stale values when using WhenAnyValue and...

To demonstrate the problem more clearly I have increased the number Foo properties:public class Foo : ReactiveObject{ [Reactive] public int Bar { get; set; } [Reactive] public int Baz { get; set; }...

View Article

Answer by Sinatr for How to queue WhenAnyValue subscriber calls containing...

Using this answer I've made my own SybscribeAsync extension method with parameter:public static IDisposable SubscribeAsync<T>(this IObservable<T> source, Func<T, Task> func) =>...

View Article

How to queue WhenAnyValue subscriber calls containing asynchronous code?

What is the correct way to prevent subscribers to be called in parallel, before previous call is completed?I have kind of race condition atm with code like thisSomeReactive.WhenAnyValue(o =>...

View Article

How to avoid stale values when using WhenAnyValue and null propagation?

I need to monitor for changes of nullable Foo, including Foo = null or changes of any property like Foo.Bar = 123.So I am using this syntax (similar to recommended):WhenAnyValue(o => o.Foo, o =>...

View Article


Image may be NSFW.
Clik here to view.

Application.Startup event limitations (bug?)

It says, I can use Startup event for many things, like initialization, creating multiple forms, blablabla.However, try to create a new WPF application and add this event handler: private void...

View Article

Answer by Sinatr for How to serialize properties into separate Json using...

You can use json converters to customize produced json and perform custom steps (creating separate json-files in your case).Just to get you started, here is a converter:public class XConverter :...

View Article


Comment by Sinatr on Is it possible to deconstruct safely, e.g. with named...

I often refactor methods arguments, so I may do similar to what method returns. Also deconstructing of records doesn't have much support from intellisense, the method help just shows Bla and not Bla(a,...

View Article

Comment by Sinatr on Function definition with prototype vs without prototype

Related topic, but I can't dig the clear answer to my question out of it.

View Article


Answer by Sinatr for Binding DataGridCell content to Textbox in Customized...

You need to do something like this:<Style TargetType="DataGridCell"><Setter Property="ToolTip"><Setter.Value><ToolTip><TextBox Text="{Binding PlacementTarget.DataContext,...

View Article

Answer by Sinatr for How to run TextTransform.exe from VS 2015 on PC without...

There is a new official toolTextTransformCore.exe (all arguments are the same as TextTransform.exe), which is much easier to copy (all required files are there) and use (just copy required files and...

View Article

Comment by Sinatr on c# winformchart symmetric majorgrid

Please refer to minimal reproducible example, you have to show your exact case. I was hoping the provided help would be enough for you to continue on your own.

View Article

Comment by Sinatr on WPF ComboBox Display list of selected values

@IvanSerdukov, didn't noticed that issues. Try the fix.

View Article


Answer by Sinatr for How to disable TAB key in ContextMenuStrip?

To disable Tab-key in menus you need to handle PreviewKeyDown and set e.IsInputKey, this seems to prevent selection logic from running.There is a problem with sub-menus, because each drop-down has its...

View Article


Comment by Sinatr on How to discard property being written from json converter?

@Cleptus, what is your idea? Which attribute and where to apply?

View Article

Comment by Sinatr on Set size of WPF dialog in Loaded causes flickering and...

Initialized event - too early, Loaded - too late. In between there is a SourceInitialized event. Try it. Use mine approach to measure container, rather than going yourself through its children.

View Article

Answer by Sinatr for How to change visibility for some TreeDataGrid rows?

You will not be able to set TreeDataGridRow.IsVisible from Selector, because (as of now) it is set to true with LocalValuepriority. In the future pay attention to "Priority" column in Avalonia...

View Article


Answer by Sinatr for Is there a simple way to describe a list of equal...

How about using attached properties and syntax like this:<!-- Define xmlns:b="clr-namespace:Behaviors" --><!-- Create 5 columns: 1/3 width, 2/3 width, auto, auto and 50 pixels --><Grid...

View Article

Answer by Sinatr for How to lazily evaluate C# anonymous class property

Rather than storing result as object, why not storing lambda, which retreives it?Changevar obj = new { Number = GetNum() };DoSomeWork();Serialize(obj);tovar lazy = () => new { Number = GetNum() };...

View Article

Answer by Sinatr for Trying to get the number of weeks as displayed in a...

You are missusing GetWeekOfYear parameters, the last one should be same value for both calls, e.g. DayOfWeek.Monday.The correct value of firstWeek is 22, not 23 (fiddle).

View Article

Answer by Sinatr for Images Layout in FlowDocument

You need to put multiple images into same BlockUIContainer, using WrapPanel as its child.Here is xaml to demonstrate, converting it to code-behind should be fairly straightforward, you will need to...

View Article



Image may be NSFW.
Clik here to view.

Answer by Sinatr for Rectangular button with a progressbar along the contour...

It's combination of several questions, including:how to draw circular progress;how to clip rounded rectangle...I quickly pack few things together to get you started. There is still work to do...

View Article

Comment by Sinatr on How do I solve this "operation did not complete...

You distribute your application by creating installer. For simple app just publish it as single file. It's not clear how two apps are related, likely later option is not for you.

View Article

Comment by Sinatr on Why does Math.pow(10, -4) produce different results in...

I've made a simple test to prove that result is really 0.0001 in C# by comparing binary represantation with same of mentioned constants.

View Article

Comment by Sinatr on Create waiting loop until all 3 boolean values are true

Related. Where you need to wait? In synchronous or async method?

View Article


Comment by Sinatr on What's the difference between instantiating a derived...

The assignement of Circle instance to a Shape variable is called polymorphism. The third line is the same as the first // rectangle {Rectangle} = {Rectangle}

View Article

Comment by Sinatr on How can i get from an enum property another string back?

Hint: To accociate name "offline_access" with PermissionScope.OfflineAccess (those are different) you can use attributes on enum values or create extension method/dictionary. See duplicate for ideas of...

View Article

Comment by Sinatr on Is possible to create an explicit conversion between two...

The tricky part of question is explicit convertion, which would be EnumB enumB = (EnumB)enumA;

View Article


Comment by Sinatr on Is possible to create an explicit conversion between two...

@MathiasR.Jessen, cool, but meaningless in given context. It will just output member with same integer value. I guess the expectations are that conversion of EnumA.A produces EnumB.W, rather than...

View Article


Comment by Sinatr on With PascalCase, how does one write a word like "iPhone"?

I like the option 2. The first one has "Fori" ("Fori Phone"?) and the third has ugly "Iphone". The "i" in iPhone is an acronym, so member name should be called IPhone (see related question).

View Article

Comment by Sinatr on Win form does not open if you run exe from another...

You are not running "another application" anywhere, that would require the use of Process methods. Without seeing minimal reproducible example it will be hard to help you. In the last snippet the...

View Article

Comment by Sinatr on Set background color to dynamically created DataGrid...

Make a very small minimal reproducible example, with one or few DataItem populated, complete xaml and all. Explain what you get and what you want to get instead. Include errors if any (binding errors...

View Article

Comment by Sinatr on MSExcel Interop c# - Can't reverse secondary horizontal...

Put the problematic piece of code inside try/catch and post the exception.

View Article


Comment by Sinatr on Get Version of the Windows Terminal (wt.exe)

You may also find wt.exe path in the registry key HCU\Software\Microsoft\Windows\CurrentVersion\App Paths\wt.exe as default value.

View Article
Browsing latest articles
Browse All 367 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>