custom-controls

Images in a WPF Custom Control Library

倾然丶 夕夏残阳落幕 提交于 2019-12-08 07:56:53
问题 I need to put an image in the default view of a custom control. However, whenever I try to test the control it can't locate the image. I have tried to compile it as an embedded resource and just a plain resource in VS. Neither of these have worked. So is there a correct way to do this? 回答1: Look at this post: How can I get a BitmapImage from a Resource? 回答2: That's probably because you specified the image path as a relative path. You should use the Pack URI Scheme to specify that the resource

Custom Views in the application (Android)

微笑、不失礼 提交于 2019-12-08 06:32:43
问题 I've a drawable for some items like buttons, checkboxes, progress bars and I'd like to define those drawables for beeing the default style of all the buttons my app uses. Is that possible without declaring the style in each View individually? If the answer is to use a Theme for the app I'd appreciate an example (changing the style of all the buttons for example) because I don't understand how to define it. Thanks in advance 回答1: The answer is to use a theme as you were expecting. Good

Creating a custom control in Xamarin

对着背影说爱祢 提交于 2019-12-08 05:44:54
问题 I'm porting my app from Windows Phone 8 to Android - and I need to create a few custom UI controls. I tried to create an XML layout, creating a LinearLayout inside it as the control and then add it dynamically (After user's desire) - but that didn't work. How can I accomplish this the easiest way as possible? This is the code i tried: MainActivity.cs: using System; using Android.App; using Android.Content; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS;

Android How to avoid weekend from android default date picker

戏子无情 提交于 2019-12-08 05:23:29
问题 I want to make a custom date picker in Android which will only show weekdays i.e. Monday to Friday, skipping week-end. looking for some help to start with. 回答1: Take a look at this project. In this case he only removed Sundays but you can adjust it to remove Saturdays also, like this: if (choosenDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || now.compareTo(choosenDate) < 0) { dateTextView.setTextColor( Color.parseColor("#ff0000") ); ((Button)

SIlverlight Generic Template Animat Parent Control Property

爱⌒轻易说出口 提交于 2019-12-08 04:30:24
问题 I have a custom control with its template defined in a generic.xaml. It is a two row grid in which the second row can be "retracted into" the first row. However, I found that when I simply animated the height of the second row or the grid to acheive the desired results, the parent of the template (i.e the instance of my custom control) still had the same height. This lead to list boxes with lots of white space in them between each element. I need to just have the animation change the height

Making a OneWayToSource/TwoWay binding on custom control

你。 提交于 2019-12-08 04:27:21
问题 I have a custom control with a dependency property, defines as follows: public class TemplatedTextBox : TextBox { public static readonly DependencyProperty SearchStringProperty = DependencyProperty.Register("SearchString", typeof(string), typeof(TemplatedTextBox), new UIPropertyMetadata(string.Empty)); public string SearchString { get { return (string)GetValue(SearchStringProperty); } set { SetValue(SearchStringProperty, value); } } } I use the following control template: <WpfApp

Custom ArrayAdapter for a Spinner: drop down view not working properly

丶灬走出姿态 提交于 2019-12-08 03:40:28
问题 I created a custom ArrayAdapter for a Spinner . The difference is, that it shows images from an ArrayList of a complex class instead of plain text. It works so far. The Images and the radio buttons are displayed as desired. The problem is, that the drop down view doesn't behave correctly: it doesn't close on a click and only the radio buttons are clickable instead of the whole view. Does anybody has an idea what's wrong? Do I have to implement some kind of listener in the adapter ?? Here's

Can we create a circular uitableview in iphone program?

一曲冷凌霜 提交于 2019-12-08 02:53:43
问题 Can we create a Circular/ Rounded Shape UITableview ? I know that we can rounded the corners of table view or by transform we can rotate table view but is need UITableview to scroll in clock wise or anti-clock wise direction. Can we use some other custom control to implement this. 回答1: Check these links.. https://www.cocoacontrols.com/controls/circleview and https://iphone2020.wordpress.com/tag/circular-tableview/. It may help you. 回答2: For anybody who has trouble with the above links, you

How can I override behavior of DockStyle Editor in PropertyGrid

二次信任 提交于 2019-12-08 01:36:41
问题 We have a custom panel which inherits Panel and has an Orientation property implemented similarly to the SplitContainer Orientation property. For our custom panel, DockStyle.Fill is never valid and depending on the Orientation property value, DockStyle needs to be Left or Right for Vertical or Top or Bottom for Horizontal. The DockStyleEditor class is sealed so we can't subclass it for our own custom UITypeEditor. Is there a way to override certain behaviors using a TypeDescriptor or some

How to customize an android spinner similar to gmail app?

时光怂恿深爱的人放手 提交于 2019-12-07 17:54:24
I'm kind of new to android, so sorry in advance if this is a silly question. I wanted to get some guesses on how gmail (or other apps) accomplish their custom spinner title, as shown in the picture: I am mainly interested in the "Recent" text. How do they achieve this kind of customization? Thanks in advance. duggu you just need to implement popup window http://developer.android.com/reference/android/widget/PopupWindow.html example with source code http://www.androidhub4you.com/2012/07/how-to-create-popup-window-in-android.html and also see this link How to create a popup window in android?