custom-controls

Best practice approach for scrollable control in C# .NET

我与影子孤独终老i 提交于 2019-12-22 17:57:48
问题 I am designing a windows forms control for Syntax Editing. I know there are already a lot out there, like Scintilla, FastColoredTextBox, Actipro Syntax Editor, Avalon Edit etc. I have reasons for designing my own, so that's not the issue. So far I have been designing the look and feel of the control. It will need to be able to control vertically, and horizontally. The options I have come across are: My control extends ScrollableControl or ContainerControl My control instantiates a HScrollBar

How to draw the arc of a three point angle?

拟墨画扇 提交于 2019-12-22 12:18:21
问题 I'm creating a control where it can draw an angle. I have three dependency objects. Radius: Lenght of the line StartAngle: From what degree should I start Angle Here's a screenshot about the program currently draws (the red line is what I'm trying to draw). So what I haven't accomplished yet is the arc. I need some help to draw it. Here's what I have. public class AngleControl2 : Control { static AngleControl2() { DefaultStyleKeyProperty.OverrideMetadata(typeof(AngleControl2), new

How to create binding inside custom control automatically?

时光毁灭记忆、已成空白 提交于 2019-12-22 11:27:30
问题 I have my custom toolbar control with DependencyProperty IsBusy Here is how I use it: <Controls:myToolbar Grid.ColumnSpan="5" Mode="DataEntry" Status="{Binding State, Converter={StaticResource ViewEditingStateToToolbarStateConverter}}" IsBusy="{Binding IsBusy}"/> By convention all my VM's inherit from base VM and have IsBusy property. So, I KNOW that this property will always be available on VM. Now I have another 4 properties like this. Instead of adding them to XAML on all my views I want

Custom PopOver with pattern border

妖精的绣舞 提交于 2019-12-22 11:09:49
问题 I'm trying to implement popover like that: I've spent quite a lot of time trying to customize UIPopoverController and UIPopoverBackgroundView . As I understand my task is impossible with public API for popovers. It is possible: To use small image with fixed corners and stretchable center, in that case I'll have stretched stripes on the side. And also I'll have image "under" the arrow. Fill border with stripes, but in that case I don't have rounded corners. I also have annoying inner shadow

NSSharingService on mountain lion without sharing window

左心房为你撑大大i 提交于 2019-12-22 09:09:41
问题 On mountain lion, I try the new sharing possiblities with the NSSharingService class of AppKit.framework Everything goes fine with this kind of code NSArray* array = @[ @"myText", [NSImage imageNamed:@"myImageFile"] ]; NSSharingService* sharingServiceFB = [NSSharingService sharingServiceNamed:NSSharingServiceNamePostOnFacebook]; [sharingServiceFB performWithItems:array]; But I'd like to do the same without the sharing window generated by the performWithItems function. As I'm considering that

How do I specify a required attribute in a custom .NET Web control?

陌路散爱 提交于 2019-12-22 04:20:32
问题 private string _itemId; [Browsable(true), Description("Required identifier for the Item.")] public string ItemId { get { return _itemId; } set { if (string.IsNullOrEmpty(_itemId)) { _itemId = value; } } } How would I actually make that required when someone uses the control? I'm trying to find an attribute that says something like Required(true). 回答1: I don't know that there's an attribute for this. I believe on the Page_Load event (or perhaps some rendering event) just check if the value has

ListView with a (half- and or) hidable header

允我心安 提交于 2019-12-21 05:41:26
问题 My Problem, is that I don't even know what to search for. I want a ListView. This ListView has some Elements with a "sticky" state. If I scroll down the List on the device, I want that all ListElements with state "sticky", to be sticky ontop of the list (non-scrollable) till there is another one "pushing it away". The rest of the elements are supposed to scroll as normal. I've seen that kind of List in the Google Market. If you have a big screen you can see that list on the Detailview of any

I want a beautiful custom window for my first cocoa app [closed]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 05:41:00
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm a graphic designer - turned web designer - turned web developer - who is currently trying to turn into a mac developer. I've nearly done programming my first app. Is a very, very simple application but I'm happy because I'm learning a lot of new stuff. The problem is: I don't like how it looks. As you may

Custom control OnApplyTemplate called after dependency property callback

别等时光非礼了梦想. 提交于 2019-12-21 04:08:30
问题 I'm developing my first WPF custom control and I'm facing some problems, here's a simplified version of the code I'm currently using: using System.Windows; using System.Windows.Controls; namespace MyControls { [TemplatePart(Name = "PART_Button", Type = typeof (Button))] public class MyControl : Control { public static readonly DependencyProperty ContentProperty = DependencyProperty.Register("Content", typeof (object), typeof (MyControl), new PropertyMetadata(null, OnLabelPropertyChanged));

Multiple ListRows for each Header on BrowseFragment - Leanback library

廉价感情. 提交于 2019-12-21 04:06:27
问题 I'm getting started with Leanback support for our app. As per UI requirements I need to add multiple list rows corresponding to each header, it's exactly like what Youtube App does on Android TV. Default ListRowPresenter seems to be rendering only one list row and its header. Is there any presenter that supports multiple list rows? I'm thinking on the lines creating a custom presenter with RowsFragment embedded in each item, correct me if my approach is wrong. 回答1: The Leanback team has