本文整理汇总了C#中Button.SetOnClickListener方法的典型用法代码示例。如果您正苦于以下问题:C# Button.SetOnClickListener方法的具体用法?C# Button.SetOnClickListener怎么用?C# Button.SetOnClickListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Button
的用法示例。
在下文中一共展示了Button.SetOnClickListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
ViewGroup layoutRoot = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_dataform_features, null);
CheckBox readOnly = (CheckBox)layoutRoot.FindViewById(Resource.Id.readOnly);
readOnly.SetOnCheckedChangeListener(this);
dataForm = Android.Runtime.Extensions.JavaCast<RadDataForm>(layoutRoot.FindViewById(Resource.Id.dataForm));
person = new Person();
person.AddPropertyChangedListener(this);
dataForm.SetEntity (person);
RangeValidator validator = (RangeValidator) dataForm.GetExistingEditorForProperty("Age").Property().Validator;
validator.Max = 30;
validator.Min = 18;
Spinner commitModes = (Spinner)layoutRoot.FindViewById(Resource.Id.commitModeSpinner);
commitModes.Adapter = new ArrayAdapter(this.Activity, Android.Resource.Layout.SimpleSpinnerItem, CommitMode.Values());
commitModes.OnItemSelectedListener = this;
personText = (TextView)layoutRoot.FindViewById(Resource.Id.personText);
commitButton = (Button) layoutRoot.FindViewById(Resource.Id.manualCommit);
commitButton.SetOnClickListener(this);
return layoutRoot;
}
示例2: OnCreate
protected override void OnCreate (Bundle savedInstanceState)
{
TapjoyLog.EnableLogging (true);
base.OnCreate (savedInstanceState);
SetContentView (Resource.Layout.activity_features);
debugTextView = (EditText)FindViewById (Resource.Id.debug_output_field_features);
// Set up API button click listeners
offers = (Button)FindViewById (Resource.Id.OffersButton);
offers.SetOnClickListener (this);
events = (Button)FindViewById (Resource.Id.EventsButton);
events.SetOnClickListener (this);
getDirectPlayVideoAd = (Button)FindViewById (Resource.Id.GetDirectPlayVideoAd);
getDirectPlayVideoAd.SetOnClickListener (this);
vc = (Button)FindViewById (Resource.Id.VirtualCurrencyButton);
vc.SetOnClickListener (this);
if (!isAppManaged ()) {
vc.Visibility = ViewStates.Gone;
}
}
示例3: SelectPicPopWindow
public SelectPicPopWindow (Activity _activity,View.IOnClickListener listener)
{
activity = _activity;
LayoutInflater inflater = (LayoutInflater) activity.GetSystemService (Context.LayoutInflaterService);
contentView = inflater.Inflate(Resource.Layout.headImgSelectorPop, null);
ContentView = contentView;
btn_take_photo = contentView.FindViewById<Button> (Resource.Id.btn_take_photo);
btn_pick_photo = contentView.FindViewById<Button> (Resource.Id.btn_pick_photo);
btn_cancel = contentView.FindViewById<Button> (Resource.Id.btn_pic_cancel);
//设置宽度、高度
Width = Android.Views.ViewGroup.LayoutParams.MatchParent;
Height = Android.Views.ViewGroup.LayoutParams.WrapContent;
Focusable = true;
OutsideTouchable = true;
SetBackgroundDrawable (new ColorDrawable());
AnimationStyle = Resource.Style.Animationbottom;
//设置按钮绑定
btn_take_photo.SetOnClickListener (listener);
btn_pick_photo.SetOnClickListener (listener);
//取消
btn_cancel.Click += (sender, e) =>
{
Dismiss();
};
DismissEvent+= (sender, e) =>
{
BackgroundAlpha(1f);
};
}
示例4: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SupportActionBar.Hide();
SetContentView(Resource.Layout.Login);
loginViewModel = new LoginViewModel();
ServiceLocator.Dispatcher = new DispatchAdapter(this);
loginField = FindViewById<EditText>(Resource.Id.username);
passwordField = FindViewById<EditText>(Resource.Id.password);
submit = FindViewById<Button>(Resource.Id.submit);
submit.SetOnClickListener(this);
ServiceLocator.Messenger.Subscribe<BaseViewMessage>(m =>
{
switch (m.Content.message)
{
case BaseViewMessage.MessageTypes.CONNECTION_ERROR:
Toast.MakeText(this, "Erro de conexão", ToastLength.Short).Show();
break;
case BaseViewMessage.MessageTypes.LOGIN_CONNECTION_OK:
getCourses();
break;
case BaseViewMessage.MessageTypes.COURSE_CONNECTION_OK:
intent = new Intent(this, typeof(CoursesActivity));
intent.SetFlags(ActivityFlags.ClearTop);
StartActivity(intent);
break;
default:
break;
}
});
}
示例5: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
ViewGroup rootLayout = (ViewGroup) inflater.Inflate(Resource.Layout.fragment_dataform_validation_mode, null);
Spinner validationModeSpinner = (Spinner) rootLayout.FindViewById(Resource.Id.data_form_validation_mode_spinner);
validationModeSpinner.OnItemSelectedListener = this;
validationModeSpinner.Adapter = new ArrayAdapter(this.Activity, Android.Resource.Layout.SimpleSpinnerItem, new ValidationMode[]{ValidationMode.Immediate, ValidationMode.OnLostFocus, ValidationMode.Manual});
dataForm = new RadDataForm(this.Activity);
dataForm.LayoutManager = new DataFormLinearLayoutManager(this.Activity);
dataForm.CommitMode = CommitMode.Manual;
dataForm.ValidationMode = ValidationMode.Immediate;
Person joe = new Person();
joe.Name = "Joe";
joe.Mail = "[email protected]";
dataForm.SetEntity (joe);
validateButton = (Button)rootLayout.FindViewById(Resource.Id.data_form_validate_button);
validateButton.SetOnClickListener(this);
rootLayout.AddView(dataForm, 0);
return rootLayout;
}
示例6: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
ViewGroup layoutRoot = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_dataform_features, null);
CheckBox readOnly = (CheckBox)layoutRoot.FindViewById(Resource.Id.readOnly);
readOnly.SetOnCheckedChangeListener(this);
dataForm = Android.Runtime.Extensions.JavaCast<RadDataForm>(layoutRoot.FindViewById(Resource.Id.dataForm));
dataForm.LayoutManager = new DataFormLinearLayoutManager (this.Activity);
person = new Person();
person.AddPropertyChangedListener(this);
dataForm.Entity = new XamarinEntity(person);
DataFormSpinnerEditor editor = Android.Runtime.Extensions.JavaCast<DataFormSpinnerEditor> (dataForm.GetExistingEditorForProperty("EmployeeType"));
editor.Adapter = new Com.Telerik.Widget.Dataform.Visualization.Editors.Adapters.EditorSpinnerAdapter (this.Activity, new Java.Lang.Object[] { "PROGRAMMER", "MANAGER", "SUPPORT", "MARKETING" });
RangeValidator validator = (RangeValidator) dataForm.GetExistingEditorForProperty("Age").Property().Validator;
validator.Max = 30;
validator.Min = 18;
Spinner commitModes = (Spinner)layoutRoot.FindViewById(Resource.Id.commitModeSpinner);
commitModes.Adapter = new ArrayAdapter(this.Activity, Android.Resource.Layout.SimpleSpinnerItem, CommitMode.Values());
commitModes.OnItemSelectedListener = this;
personText = (TextView)layoutRoot.FindViewById(Resource.Id.personText);
commitButton = (Button) layoutRoot.FindViewById(Resource.Id.manualCommit);
commitButton.SetOnClickListener(this);
return layoutRoot;
}
示例7: InitTabBtnView
private void InitTabBtnView( ) {
tab_btn_writeAdvice = FindViewById<Button>(Resource.Id.tab_btn_writeAdvice);
tab_btn_recordAdvice = FindViewById<Button>(Resource.Id.tab_btn_recordAdvice);
tab_btn_writeAdvice.SetTextColor(Resources.GetColor(Resource.Color.blue));
tab_btn_writeAdvice.SetOnClickListener(this);
tab_btn_recordAdvice.SetOnClickListener(this);
}
示例8: OnViewCreated
public override void OnViewCreated (View view, Bundle savedInstanceState)
{
texture_view = (AutoFitTextureView)view.FindViewById (Resource.Id.texture);
texture_view.SurfaceTextureListener = surface_texture_listener;
button_video = (Button)view.FindViewById (Resource.Id.video);
button_video.SetOnClickListener (this);
view.FindViewById (Resource.Id.info).SetOnClickListener (this);
}
示例9: Init
public void Init (Activity activity, Button playButton)
{
// This called by the containing activity to supply the surrounding
// state of the game that it will interact with.
mPlayButton = playButton;
mPlayButton.SetOnClickListener (this);
SetGamePaused (true);
mFader = () => Run ();
}
示例10: OnCreate
override protected void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(R.Layouts.share_activity);
mSendButton = (Button)FindViewById(R.Ids.send_interactive_button);
mSendButton.SetOnClickListener(this);
mSendButton.SetEnabled(true);
mEditSendText = (EditText)FindViewById(R.Ids.share_prefill_edit);
mPlusClientFragment =
PlusClientFragment.GetPlusClientFragment(this, MomentUtil.VISIBLE_ACTIVITIES);
mSharing =
savedInstanceState != null && savedInstanceState.GetBoolean(STATE_SHARING, false);
}
示例11: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.acitivity_demo);
_scrollView = FindViewById<ParallaxScrollView>(Resource.Id.scroll_view);
_factorText = FindViewById<TextView>(Resource.Id.factor_text);
_minus = FindViewById<Button>(Resource.Id.minus);
_minus.SetOnClickListener(this);
_plus = FindViewById<Button>(Resource.Id.plus);
_plus.SetOnClickListener(this);
}
示例12: CustomEditor
public CustomEditor(RadDataForm dataForm, IEntityProperty property) : base(dataForm,
dataForm.EditorsMainLayout,
dataForm.EditorsHeaderLayout,
Resource.Id.data_form_text_viewer_header,
Resource.Layout.dataform_custom_editor,
Resource.Id.custom_editor,
dataForm.EditorsValidationLayout,
property)
{
editorButton = (Button)EditorView;
editorButton.SetOnClickListener(this);
((TextView)HeaderView).Text = property.Header;
}
示例13: OnCreate
protected override void OnCreate (Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
SetContentView (Resource.Layout.activity_main);
mAdView = FindViewById<AdView> (Resource.Id.adView);
var adRequest = new AdRequest.Builder ().Build ();
mAdView.LoadAd (adRequest);
mInterstitialAd = new InterstitialAd (this);
mInterstitialAd.AdUnitId = GetString (Resource.String.test_interstitial_ad_unit_id);
mInterstitialAd.AdListener = new AdListener (this);
mLoadInterstitialButton = FindViewById<Button> (Resource.Id.load_interstitial_button);
mLoadInterstitialButton.SetOnClickListener (new OnClickListener (this));
}
示例14: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate (bundle);
// Set our view from the "main" layout resource
SetContentView (Resource.Layout.Main);
//var viewGroup = ((ViewGroup)FindViewById<TextView> (Resource.Id.InstructionStep1).Parent);
//viewGroup.SetOnTouchListener(new OnSwipeListener(this));
_viewFlipper = FindViewById<ViewFlipper>(Resource.Id.ViewFlipper);
// Button
_button = FindViewById<Button>(Resource.Id.button1);
_button.SetOnClickListener(this);
var onSwipeListener = new OnSwipeListener (_viewFlipper, this);
FindViewById(Resource.Id.step1View).SetOnTouchListener (onSwipeListener);
FindViewById(Resource.Id.step2View).SetOnTouchListener (onSwipeListener);
FindViewById(Resource.Id.step3View).SetOnTouchListener (onSwipeListener);
FindViewById(Resource.Id.step4View).SetOnTouchListener (onSwipeListener);
}
示例15: init
private void init() {
var prefs = PreferenceManager.GetDefaultSharedPreferences (this);
//TODO : change the 1 as like in native app
int initialColor = prefs.GetInt ("color_3", 1);//Convert.ToInt32("4278190080"));
mColorPickerView = (ColorPickerView) FindViewById(Resource.Id.color_picker_view);
mOldColorPanelView = (ColorPanelView) FindViewById(Resource.Id.color_panel_old);
mNewColorPanelView = (ColorPanelView) FindViewById(Resource.Id.color_panel_new);
mOkButton = (Button) FindViewById(Resource.Id.okButton);
mCancelButton = (Button) FindViewById(Resource.Id.cancelButton);
((LinearLayout) mOldColorPanelView.Parent).SetPadding(
(int)Math.Round(mColorPickerView.getDrawingOffset()),
0,
(int)Math.Round(mColorPickerView.getDrawingOffset()),
0);
mColorPickerView.setOnColorChangedListener(this);
mColorPickerView.setColor(initialColor, true);
mOldColorPanelView.setColor(initialColor);
mOkButton.SetOnClickListener(this);
mCancelButton.SetOnClickListener(this);
mOkButton.Click += (sender, e) => {
var edit = PreferenceManager.GetDefaultSharedPreferences(this).Edit();
edit.PutInt("color_3", mColorPickerView.getColor());
edit.Commit();
Finish();
};
mCancelButton.Click += (sender, e) => {
Finish();
};
}