WP7 - How can I retrieve the mini form of a Path at runtime? - data-binding

I've got a databound series of predefined shapes (Path with Data="" set) which each trigger the same event when clicked.
I'd like to programmatically access the mini form of the Path.Data property at runtime to be able to persist it.
In this case I could just name the elements and on click check which one, however I'd prefer a more generic solution.
There seem to be some WPF workarounds but I haven't seen any for WP7.
Does anyone know if this is possible? and if so, how to do it?
Thanks.

Looking in to if and how this may be possible I came across http://www.eightyeightpercentnerd.dreamhosters.com/?p=40 and even though it's quite old it explains how a paths data/geometry is parsed in Siverlight.
It leads me to think that you may be better off trying to find a different approach to solving your problem. :(

Related

TornadoFX: Label text not updating

One of the issues I'm currently experiencing is that I can't seem to change the text of a Label which is implemented in a dynamically loaded AnchorPane. I assume this might be related to the controller and how JavaFX/TornadoFX works, but I can't seem to find what I'm doing wrong.
The issue itself occurs in this class, and happens in the showSystemDetails() method. What I would expect to happen is that upon pressing the "System Details" button in the sidebar, the labels would update to the required value, but this isn't happening for some reason.
Please feel free to point me to what I'm doing wrong, or provide any constructive criticism. The project is still in full development so a lot of things are still messy/broken.
The reason this isn't working is that you're manually loading a new version of the FMXL file every time you select something in your menu. The FXML file originally loaded by SystemDetailsViewProxy is updated correctly, but that's not the one you're showing on screen anymore.
To see the updated View, make sure you put the root node of the SystemDetailsViewProxy instance back.
You could for example change your DrawerMenuButton enum to contain references to SystemDetailsViewProxy::class instead of those two strings, and use add(viewClass) to add the correct root node to your view when clicking the menu buttons.
Furthermore, you should be using ViewModels and binding instead of manually updating the text property of the labels. You're doing an awful lot of manual/error prone work that the framework can help you with for free.
Your application is not using best practices in several important areas, and you're rolling your own solutions for stuff that the framework already does very well :)
Views are singletons when managed by the framework, but you instantiate them yourself instead of using inject/find. The result is that important life cycle methods are not being called.
I would also suggest looking into type safe builders instead of FXML.
Hope this helps :)

How to make MultiValueField with Composite Fields and i18n enabled work properly?

Have anyone tried to have a form with MultiValueField in Magnolia having Composite fields with i18n enabled and is working properly?
Currently, I'm encountering some weird behaviour when adding items to English then switching to other language and adding items again then switch back to English with items all gone. In one JIRA post it said it was already fixed but I still encounter this issue. Also encountered issues in sorting which apparently not supported by the DelegatingMultiValueTransformer.
If so, can you please show me the configuration you use to make this work properly? If needed customisation, can you give me ideas on how to do it?
Would really appreciate any help on this.
Btw, I'm using the latest release 5.4.6 now.
Maybe you don't want to put two questions in one request in the future ;)
Re language issue:
did you check that you have i18n enabled also on the subfields, since you are using deletage transformer? AFAIK with delegate you need to have them enabled on all fields in the hierarchy.
Re transformer & ordering:
IMO the only way out is to write custom transformer. Look at source code of MultiValueTransformer and in the part of the code where it goes just two levels down when checking child values, you need to go deeper.
You would also need to define different structure storage for your values there since one used by the MultiValueTransformer would not suffice for multiple levels.
Perhaps you can extend one of the more specialized MultiValue*Transformer or perhaps you try MultiValueJSONTransformer if storing all values in json array is enough for you (you would still need to extend it and to repopulate values back into dialog when opening dialog for editing).
HTH,
Jan

Need to disable an array of ctrl keys for my site

Especially Ctrl+I , which is "mail this page". I'm using wordpress self hosted. So far I've found this code, not sure how to implement it or if it's old.
Please no plethora of reasons as to why you find this attempt pointless.
Really, shouldn't answer, but:
There's no reason for this, because there's always a very easy way around it. It'll probably take a lot more work than whatever you end up with's worth. If somebody has half of a computer literate mind, they probably can get past this without a problem at all.
Summary:
Don't bother
Disabling hotkeys won't stop anyone from just selecting that option from the File menu.
People will always find ways around these kinds of hacks. Turning off JavaScript, hacking the source with Firebug, Option+Click on a Mac, taking a screenshot, etc. They are completely ineffective against anyone even slightly determined to do what you don't want them to do.
You can't really do that. See this page for really good information on the portability of various key events in JavaScript across multiple browsers. You will see for one that each browser handles/responds to various key events in many different ways.
Also, most of the default browser actions (e.g. Ctrl-F, Ctrl-S) cannot be canceled if you are capturing key events. You can still detect some of them and respond, but you can't actually stop the browser from displaying the search dialog or whatever specific action is to be performed by the key combination.
Also, if someone really wants to take your page's HTML/JavaScript code or content, these methods won't stop them. The disable right click code from the link you referenced can prevent right click, but all someone has to do is disable javascript and it no longer works.

AdvanceDataGrid nodes collapse on refresh

I have an AdvancedDataGrid which Im attemping to update with data from a web service that I poll once very 10 seconds. Im using a HierarchicalData object to provide data to the grid. The update seems to work fine, except that on each update, any nodes that were expanded are collapsed when the grid is refreshed. Stranger still, when I dig down into the bowels of the thing and look at the contents of the HierarchicalCollectionView that backs the grid, I can see that the openNodes property correctly contains the nodes that I opened, but those nodes are not shown as open on the grid...the state seems inconsistent. Any help would be much appreciated!
I try and steer clear of that component. I think your best bet is to extend it and implement the functionality you need (you will probably end up overriding a good amount of logic to get what you need).
You already know that you can utilize the openNodes property...
I know this answer doesn't help you immediately, but you will thank yourself later if you take the time to roll out your own component.

Telerik Rad Combo and async postbacks in asp.net

it looks like nobody has posted on this.
I have a very typical set up, an ajax update panel is updated when a drop list of offices changes. Each form could have it's own values, for instance each store will have it's own list of employees. Here is where the fun begins. The form can be changed by the drop down (new office) or validated and submitted.
On drop down change, I create a new instance of the same rad combo, bind it to the current data, confirm that the correct data is bound. Then on the return trip I see selected the default user from the previous user. This is a composite control, and firebug shows me that the value for the "text box" that simulates the combo still has the old value. I'm suspecting onViewStateLoaded, but turning viewstate off for the Telerik didn't help any. II don;t need it anyway, cuz I have to put the selected value in another hidden to make a cross page post on submit. Any ideas before I hack this up really bad? Any will be appreciated.
I would answer your question directly, but I don't have enough info, as I was not able to duplicate the issue here locally.
Have you tried contacting Telerik support, or using their forums? I've found them to be quite responsive, even offer custom dll's for some solutions.
Like Jeff, I have a difficult time rebuilding your scenario from the description. The fastest way to solve this problem is to open a Telerik Support Ticket. If you can provide a basic sample the exhibits the problem, the support team will quickly respond with a solution. Don't miss that valuable part of your Telerik purchase! That's what separates commercial tools from unsupported options.
If you'd prefer to keep troubleshooting, I'd try stepping back and simplifying your scenario. It sounds like some hacking has already begun and I think that may be leading to unusual results.
Specifically, the step where you create a new RadComboBox on post should not be required. If you can share some more code examples, I'll be happy to help further.

Resources