Can anybody tell me how to clone UIElement in SILVERLIGHT ? I dug a lot in the google but I'm not able to find relevant solution, everywhere I'm just getting solution to clone UIElement in WPF, however same is not applicable in the Silverlight.
One way that I've found is to serialize to XML with XamlWriter then-reload the XML with XamlReader into a new element.
For an example see http://shrinandvyas.blogspot.ca/2011/08/wpf-how-to-deep-copy-wpf-object-eg.html
Related
Further to my earlier question
Migrating iOS Hybrid App from UIWebView to WKWebview
I have made good progress and only have a few loose ends to tidy up. The overall performance improvement over UIWebView is outstanding.
In UIWebView it was possible to set the focus on a text field programatically using
webView.keyboardDisplayRequiresUserAction = NO ;
However this is not available in WKWebView and ever since 2016 programmers have been developing an updating work arounds (swizzles) to overcome this.
I have tried implementing the latest of these I could find on Stack Overflow, which I found at https://stackoverflow.com/a/55344531/5948260
However as I am very inexperienced at coding in XCode please could someone tell me exactly how I add the above solution to my project. I have tried in vain to find examples of how exactly to do this i
on GitHub or elsewhere but to no avail.
So far I have tried copying the code provided in the above answer into a .m file and adding it to my project, but I got 20 or so errors, I then added an import statement for Foundation and most of these went away but XCode complained that it did not know what class WebViewInjection is. Also must there be a corresponding header file?. Must there be a corresponding interface statement? How does the method defined in the answer get invoked?
As I could not answer any of these, I also tried adding the method into my ViewController class. Whilst this was accepted with no errors, it had no effect on my app, ie. the keyboard did not come up automatically.
I would also want the webview to resize to appear above the keyboard and not to scroll to where the text field is as this seems a very messy solution to me.
All help very gratefully received.
I have now managed to get the keyboard displayed by adding
[self allowDisplayingKeyboardWithoutUserAction];
to viewDidLoad
I kept the allowDisplayingKeyboardWithoutUserAction method declaration inside my ViewController but changed the + infront of the method declaration to a - and this seems to have worked.
I still do not know how to resize the webview when the keyboard is displayed.
I'm working on an app that'll have a range of images and the collectionview is not showing up at all. I was following this article, which I translated to C#.
here is an example app I made to show a minimal example of what I'm trying to do.
When I run through the code, GetCell in the collection source isn't firing which I know is the problem, but I don't know why it's not firing and I'm simply at a lost on what I'm missing.
I test it again today and I can make sure that the problem is caused by the MosaicCollectionLayout.
What I did today is that I removed your collectionView and add a new collectionView, then I add Constrains to it with a fixed height and width(to make sure it appears even if there is no data), then I change the layout to FlowLayout, it works, here is the screenshot:
After that, I changed the layout back to MosaicCollectionLayout, I get an exception in the line _cachedAttributes.Reverse(lastIndex.Row, firstMatchIndex.Value); inside the method LayoutAttributesForElementsInRect.
I checked the article and did not find a solution yet. Maybe there is some mistakes in the codes translated from swift to C#. So the problem is not related to the xib, please check the code in the method LayoutAttributesForElementsInRect.You can also try add Constrains to your collectionView. Hope these information helps you.
if you use the Google Plus App on Android and switch to the Stream, you get a view where you can swipe to the left and right between the All circles/Incoming/Nearby-Stream. What view component is used for this? Is this a standard Android component? Or where can I find democode how i can build such a view component?
You should take a look at the ViewPager from Android Compatibility Package for the desired widget/swipe navigation. Find more about it here
http://developer.android.com/sdk/compatibility-library.html
Also, checkout this recently posted tutorial and some sample code on ViewPager by Richard:
http://geekyouup.blogspot.com/2011/07/viewpager-example-from-paug.html
It is a combination of a ViewPager together with an indicator for where you are currently and where you can go swiping left and right.
A sample of how this can be done along with code you can use in your own apps may for example be found here. I've played with this code a little and it works pretty well.
None of the default widgets/views. I guess, it's some kind of a custom view with swipe functionality.
Honeycomb opens up a few new widgets which seem to have these functionality. Have a look here.
http://developer.android.com/sdk/android-3.0.html (New Widgets)
I used APKTool to take a look at what's going on. Hopefully it is okay to post this here. This is from version 1.0.2 of the G+ APK.
removed google+ app code as per CommonsWare's suggestion
So, it looks like they're using standard views, though perhaps with a good deal of gesture detection and smooth animation magic.
EDIT) If you really want to know about the exact inner-workings of what is going on in the Stream activity, I suggest you use APKTool yourself and examine the .smali code
Why the oncommand is not discribed in Xul button reference page?
It's even used in an example, but it's not docummented with the other methods, am I looking the wrong place?
It is documented under MDC - XUL attributes (here).
Am I missing something or is there no documentation of WPF controls?
When I look at MSDN, it says to reference System.Windows.Controls
(http://msdn.microsoft.com/en-us/library/ms752069.aspx), but this is for winforms?
Where can I find the WPF object model?
Bam!
Documentation for all WPF classes.
The URL you provide in your question (http://msdn.microsoft.com/en-us/library/ms752069.aspx) is, in fact, the documentation path for WPF controls, not for WinForm controls (see http://msdn.microsoft.com/en-us/library/system.windows.forms.aspx for WinForms). To get to the members of Treeview, for example, walkthrough Control Library >> TreeView then again click Treeview in the Reference section. I think a subtle point of confusion to Winform-only developers is to think that System.Windows.Controls is for WinForm, when it is actually for WPF.
The URL Kevin provided (http://msdn.microsoft.com/en-us/library/system.windows.aspx) is also an important one to know: it is the main documentation path for all of WPF.
Finally, if you want to get a sense of the similarities and differences between controls in WinForm and WPF, take a look at my article on Simple-Talk.com
From WinForm to WPF: A Quick Reference Guide.