Arrange Stylus properties in alphabetical order - stylus

I'm just wondering if there's any way to arrange Stylus properties in alphabetical order, preferably something I can add to my development build process? For what it's worth, I'm using minimal markup with Stylus, dropping all semicolons, braces etc. Thanks.

Related

JSX: Emmet auto-completion for elements that contain dots (E.g. Grid.Column)?

Is it possible to autocomplete elements that contain dots in their name?
E.g., in WebStorm, if I type Grid [tab] I get <Grid></Grid>, as expected. However, if I type Grid.Column [tab], I get <Grid className="Column"></Grid>.
Is it possible to escape the ., or, by any other means get Emmet to recognize it as part of the element name instead of a className property?
No.
From Sergey at Emmet (after emailing info#emmet.io):
Hi, currently, there’s no special syntax that allows dots in tag name.
Although it’s possible to implement some sort of escaping, generally
it’s not a good idea since it may break abbreviation extractions from
text content in some cases.

Format XAML UserControl and Window attributes on seperate line

In Visual Studio, I would like to configure the formatter such that UserControl or Window tags have their attributes on separate lines, but all other types have their attributes on the same line.
The standard formatter configuration places all the xmlns attributes into a long (and rather unwieldy) statement, which makes the code hard to read.
I've tried the formatter options, but the best I can get is to have attributes for all types on separate lines, which leads to untidy Setter blocks.
Is this possible in Visual Studio 2013?
You can use the XamlStyler plugin to format your XAML according to self-defined rules.
XamlStyler specific options.
Define your own attribute ordering rules
Define your own attribute line break rules
Markup extension formatting
Automatically reformat Xaml file on saving

Protecting custom inline elements in WPF RichTextBox

I'm currently spiking with the WPF RichTextBox before I decide whether or not it can be used in a project of mine.
What I need is to have elements of text representing various objects (other texts or objects), a bit like a WIKI but not quite. Clicking on such a text will make stuff happen, like navigating to other texts or providing additional options.
Anyway, as these little text bits represent other objects I would like to protect them but I have succeeded with this only in part: The user cannot position a caret inside such a text element and edit/delete it but it is still possible to make a selection and delete/replace it, including my custom elements.
Have anyone travelled down this road with the RichTextBox? My latest experiment was to simply record all custom text elements when being part of a selection and then restoring them after the (destructive) edit. That fell apart because I can't find a way to re-insert my custom inline elements (derived from the Run class). The only way I've found to programmatically insert a Run (based) element at a specified position (TextPosition) is via its constructor.
Well, any hints would be greatly appreciated.
You are really looking for a FlowDocument, not a RichTextBox.

How to handle removal of a related group of WPF UI Elements

I'm interested in what is the best way to implement the removal of related set of UI elements.
This is what I'm working on: I have a Grid embedded within a verticle Scrollviewer. The user can add multiple Listboxes to this Grid during runtime via a button click. Each ListBox, when added, will also result in the addition of the correct number of Grid Rowdefinitions and a Gridsplitter to allow the resizing of each Listbox. This parts works fine.
The trick is this -- the user also has the option of closing a Listbox. When they do this, I will need to remove the corresponding Rowdefinitions and Gridsplitter that "belongs" to the closing Listbox.
Via iteration through Grid.Children and Grid.Rowdefinitions, I could somewhat easily figure out which Rowdefinitions and Gridsplitters to remove. But I'm wondering if there is a better way to handle this. Perhaps by grouping these elements together in a collection and simply removing this collection in one fell swoop? No idea how to do this, though.
Any ideas or suggestions are greatly appreciated!
I'm not aware of an obvious or simple way to associate them within the visual/logical tree, but you could certainly use an associative array (Dictionary<T, U>) that's keyed off of the element you're removing with the contents as the other items that need to be removed.
I think this is essentially what you described.
Anything more clever wouldn't be worth the additional complexity, I think, unless you had a specific need for it. :)

Change filter in Silverlight Pivot Viewer to use AND instead of OR

I need to modify the way the filter acts in the Silverlight Pivot viewer.
I have this filter:
Keywords:
x Keyword a
_ Keyword b
x Keyword c
_ Keyword d
_ Keyword e
The filter generates “Keyword a OR Keyword c”. What I need is “Keyword a AND Keyword c”.
Is that possible?
Any help is appreciated!
What Poker Villain says is quite right but that doesn't mean the PivotViewer is not a solution for you. I had a similar problem with a system I've been working on and managed to find a suitable way of making the PivotViewer play nice. This will only work for JIT collections though since it relies on re-fetching the data.
Essentially the system I've been working on is a case management system. Much of the data associated with a case is mutually exclusive and so fits the model of the PivotViewer but there is also the ability to add 'tags' to a case and like you suggest, often the user will want to combinational logic there. Here's what I did to fix the problem.
First off,..you're gonna want a copy of Silverlight Spy. Now in the explorer tab of SSpy, you can drill right down the Visual Tree and look at the guts of the PivotViewer. Here's how mine looks...
You can see I've drilled right down into the control named 'PART_FacetPane'. Below that there's a bunch of CustomAccordianItems. Essentially, you just need to subclass the PivotViewer (that's why mine says PivotViewerEx) and override the OnApplyTemplate method.
In here you will be able to use GetTemplateChild or some other means to navigate the VisualTree and add another control yourself. In my project, I used a simple tag cloud control I'd previously built.
What I do is handle the events of the tag cloud control and append querystring values to the URL used to build the CXML and filter the data based on these parameters. It's not as fluid as being able to filter the data 'live' as it were but it's a solution for now.
It's probably worth mentioning that depending on your circumstances, you may need to add a final, randomly generated querystring value to the CXML URL so you don't get a cached copy of the data.
HTH, Stimul8d.
bottom line ... NO.
You get what you get with this control. (for now)
but you could generate a "dummy" facet that was the concatenation of all the keywords for an item. But if you had more than a few keywords, it would look very ugly.

Resources